Christmas discount
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
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 <= 10^5).
The second line contains n integers, which are the value of n bills. All integers are divisible by 1000 and do not excess 10^9.
Output
The total income of the store, round to unit
Sample
Input
5
10000 1000000 3000000 5000000 100000000
Output
100659700
Bình luận