HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


50812 - Total Discount for the clients

Guest
• Review clarifications (1)

Volume problems

• 50807 - Euro to Leke
• 50871 - Harmonic Mean
• 50859 - Low performance
• 50508 - The Biggest Area
• 50528 - Rock-Scissors-Paper
• 50744 - The Smallest Perimeter
• 50808 - Total Distance Traveled
• 50814 - Buying Books from Internet
• 50812 - Total Discount for the cl...
• 50832 - Rock Paper Scissors Lizard ...
• 51078 - Max trade
• 51077 - Grades Histogram
• 51046 - The biggest number
• 50867 - Average of the Best Grades
• Reflektimi i pikes
• 50994 - The Most Crowded Station
• 51194 - The difference between max...

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