Submit | All submissions | Best solutions | Back to list |
EIUCHRMS - Christmas discount |
Christmas is coming soon; Ngoc’s store has a promotion for all customers. Based on the value of the invoice, they will receive a discount as the following:
- Equal or less than 2 million, discount rate is 3%.
- Equal or less than 5 million, discount rate is 4%.
- Equal or less than 10 million, discount rate is 5%.
- Equal or less than 20 million, discount rate is 6%
- Equal or less than 50 million, discount rate is 7%
- Equal or less than 100 million, discount rate is 8%
- Equal or less than 200 million, discount rate is 9%
- Greater than 200 million, discount rate is 10%.
Given a list of bills, compute the total income of the store.
Input
The first line contains an integer n, which is the number of bills (0 ≤ n ≤ 105).
The second line contains n integers, which are the value of n bills. All integers are divisible by 1000 and do not excess 109.
Output
The total income of the store, round to unit
Sample
Input |
Output |
5 10000 1000000 3000000 5000000 100000000 |
100659700 |
Added by: | Ha Minh Ngoc |
Date: | 2020-12-17 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |