HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


066. 50523 - Total Tax to Pay

Guest
• Review clarifications (1)

Volume problems

• 030. 50576 - Number of Perfect nu...
• 035. 50467 - Random Numbers
• 040. 50354 - Intersecting Rectangles
• 050. 50510 - What floor are they?
• 050. 50566 - Grade Point Average (...
• 060. 50727 - Fibonacci Numbers
• 061. 50733 - The Highest Average
• 062. 50390 - Total Salary Paid
• 066. 50523 - Total Tax to Pay
• 070. 50534 - Top Trading Company
• 076. 50289 - Monthly Allowance
• 080. 50347 - Selling Oranges
• 090. 50378 - Sum of the given digits
• 095. 50453 - The Cubic Difference
• 100. 50397 - The Number of Points ...
• 110. 50409 - Random Password Ge...
• 120. 50684 - Sum of prime numbers...

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