HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


066. 50523 - Total Tax to Pay

Guest
• Review clarifications (1)

Volume problems

• 003. 50432 - Numbers and Squares
• 004. 50433 - Sum of Cubes
• 005. 50595 - Sum of the numbers
• 016. 50459 - The Biggest Digit
• 020. 50575 - Number of Prime num...
• 030. 50576 - Number of Perfect nu...
• 050. 50510 - What floor are they?
• 050. 50566 - Grade Point Average (...
• 066. 50523 - Total Tax to Pay
• 070. 50534 - Top Trading Company
• 095. 50453 - The Cubic Difference
• 125. 50578 - Mersenne prime
• 132. 50474 - Sum of Two Primes
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?
• 210. 50369 - Base Conversion

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