HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50812 - Total Discount for the clients

Guest
• Review clarifications (1)

Section problems

• 50292 - Average of 4 Marks
• 50432 - Numbers and Squares
• 50510 - What floor are they?
• 50870 - ZScore normalization
• 50797 - Nr of Missing Guests
• 50518 - Histogram Equalization
• 50522 - Multiplication Table - 2
• 50814 - Buying Books from Internet
• 50812 - Total Discount for the cl...
• 51003 - Double Prime
• 50435 - City Electric Bills
• 50527 - Sum of LCMs
• 50440 - Call Center
• 50342 - 100 Factorial
• 50439 - Telephone Calls
• 50436 - Pocket Money
• 50379 - a^b modulus k

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 Discount for the clients

A company, classifies its customers into 3 types.

  1. Regular customer: No discount
  2. Frequent customers: 6% discount
  3. Prime customers: 12% discount

Question: Write a program that reads n sales information for this month. And then, it calculates the total sales amount, and the total discount amount the name of the customer who bought the most.

Input specification
First you will be given the number of sales information (n) where n is between 0 and 5000. Then, in the following n lines you will be given

  1. The name of the customer: at most 15 char string formed from only English letters
  2. Regular amount of sale where 1 ≤ amount ≤ 1e8
  3. Customer type: an integer between 1 and 3 where type 1 is regular customer with no discount

Output specification
Show three information:

  1. The total sales amount after discount with two digits precision.
  2. Total discount amount (with two digits precision).
  3. The name of the customer who made the greatest amount of sale after the discount.

Sample Input
5
Aleksandro 140 1
Xhenisa 70 3
Myra 140 3
Merle 190 1
Ana 100 2
Sample Output
608.80 31.2 Merle

Explanation:

Nr. Name Sales AmountUser type Total DiscountAmount after discount
1 Aleksandro1401 0140
2 Xhenisa703 8.461.6
3 Myra1403 16.8123.2
4 Merle 1901 0190
5 Ana1002 694
Total 31.2608.80

And, Merle had the highest amount of buy after discount which is $190.



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

www.contester.ru