Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Total Tax to Pay
You work for a market chain. Daily report is prepared
every night. And, the amount of tax to be paid for
that day is calculated. Every item has different tax
percentage and the item price includes the tax price.
Because the total amount includes the tax, it is divided
by (1+tax).
Item Price = Base price + Tax
Base Price = (Item Price) / (1+Tax)
Question: Write a program that
is going to read the sales information and
then the program will calculate the total amount
of tax to be paid.
Input specification
You will be given an integer (n) the number of
items sold today where 0 ≤ n ≤ 1000.
Then, in each of the following n lines you
will be given 3 numbers :
- number of items sold: an integer where
0 < number of items sold ≤ 50
- item price: a floating point number
where 0 < unit price ≤ 1000
- tax percentage: a floating point
number between 0 and 0.30
Output specification:
One floating point number with three digits
precision.
Sample Input I
3
4 60 0.25
5 60 0.20
4 90 0.20
|
Sample Output I
158.0
|
Explanation: Then, the
tax for every item:
- The first item is 4x$60=$240 and 240/1.25=$192. Then, the tax is $240-$192=$48
- The second item is 5x$60=$300 and 300/1.20. Then, the tax is $50
- The first item is 4x$90=$360 and 360/1.20. Then, the tax is $60
is the tax to be paid. And the total is $158.
Для отправки решений необходимо выполнить вход.
|