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.
- Regular customer: No discount
- Frequent customers: 6% discount
- 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
- The name of the customer: at most 15 char string
formed from only English letters
- Regular amount of sale where
1 ≤ amount ≤ 1e8
- Customer type: an integer between 1 and 3 where type
1 is regular customer with no discount
Output specification
Show three information:
- The total sales amount after discount with two digits precision.
- Total discount amount (with two digits precision).
- 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 Amount | User type |
Total Discount | Amount after discount |
1 | Aleksandro | 140 | 1 |
0 | 140 |
2 | Xhenisa | 70 | 3 |
8.4 | 61.6 |
3 | Myra | 140 | 3 |
16.8 | 123.2 |
4 | Merle | 190 | 1 |
0 | 190 |
5 | Ana | 100 | 2 |
6 | 94 |
Total |
31.2 | 608.80 |
And, Merle had the highest amount of buy after discount which is $190.
Для отправки решений необходимо выполнить вход.
|