Submit | All submissions | Best solutions | Back to list |
EIDISCOU - DISCOUNT |
ABC store applies a promotion on the opening day. Customers are discounted based on different levels. Specifically:
• Amount of money between 1 thousand VND to 2 million VND: no discount
• Amount of money from 2 million VND to 10 million VND : 3% discount
• Amount of money from 10 million VND to 50 million VND : 5% discount
• Amount of money from 50 million VND to 100 million VND: 7% discount
• Amount of money from 100 million VND to 200 million VND: 10% discount
• Amount of money from 200 million VND to 500 million VND: 12% discount
• Amount of money over 500 milion VND: 15% discount
* Discount rate is applied on the amount of each level, not on the whole bill. The payment amount is rounded to the nearest whole number
The software of the store has calculated the total value of the items (N, a multiple of 1000) that the customer purchases. Write a program that helps the store calculate the amount the customer has to pay.
Input
A single line consists of 1 positive integer N (1,000 ≤ N ≤ 5 * 10 ^ 9).
Output
A single line is the amount that the customer must pay.
Example
Input:20000000
Output: 19260000
Input:55555000
Output:52926150
Added by: | Ha Minh Ngoc |
Date: | 2015-03-18 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYTHON3 RUBY SQLITE SWIFT VB.NET |