HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN111 Homeworks 2013-2015 > problem:


15-FallPr-50. 50812 - Total Discount for the clients

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

• 14-Spr2-30. 50445 - Cryptography
• 14-Spr2-50. 50437 - Age Labeling
• 15-FallHW-2. 50821 - Derivative of ...
• 15-FallHW-3. 50822 - Linked List
• 15-FallHW-4. 50823 - Secret Number
• 15-FallHW-5. 50824 - Sum of Group...
• 15-FallHW-6. 50825 - Drawing Polygon
• 15-FallPr-10. 50808 - Total Distance...
• 15-FallPr-50. 50812 - Total Disc...
• 15-FallPr-70. 50814 - Buying Books f...
• 15-FallPr-80. 50815 - Breaking the ...
• 15-FallRE-10. 50853 - Parking Place
• 15-FallRE-20. 50854 - Area of Trian...

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