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

Nguồn bài:
Ha Minh Ngoc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

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.

Sample Input:

20000000

Sample Output:

19260000

Sample Input:

55555000

Sample Output:

52926150

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.