HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN111 Homeworks 2013-2015 > problem:


14-Fall2-30. 50523 - Total Tax to Pay

CEN111 Homeworks 2013-2015

Start: Jan.10.2015 at 10:00:00 AM
Finish: Jan.10.2015 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 13-Fall2-40. 50401 - Sum of Odd N...
• 13-Fall2-50. 50400 - nth Row rth El...
• 14-Fall1-10. 50532 - Close City
• 14-Fall1-30. 50500 - Find Student
• 14-Fall1-40. 50511 - Class Average
• 14-Fall1-50. 50481 - Car Parking
• 14-Fall2-10. 50510 - What floor are ...
• 14-Fall2-20. 50504 - School contest
• 14-Fall2-30. 50523 - Total Tax t...
• 14-Fall2-40. 50514 - Bookkeeping
• 14-Fall2-50. 50534 - Top Trading C...
• 14-Fall2-60. 50487 - Radius of Inscr...
• 14-FallResit-20. 50407 - Missing Nu...
• 14-Spr2-10. 50426 - Calculating Sales
• 14-Spr2-20. 50425 - Calculating W...
• 14-Spr2-30. 50445 - Cryptography
• 14-Spr2-50. 50437 - Age Labeling

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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 :

  1. number of items sold: an integer where 0 < number of items sold ≤ 50
  2. item price: a floating point number where 0 < unit price ≤ 1000
  3. 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:

  1. The first item is 4x$60=$240 and 240/1.25=$192. Then, the tax is $240-$192=$48
  2. The second item is 5x$60=$300 and 300/1.20. Then, the tax is $50
  3. 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.



Для отправки решений необходимо выполнить вход.

www.contester.ru