#CCBCMCHIN0000029. Mức giảm giá theo bậc (Tiered Discount)
Mức giảm giá theo bậc (Tiered Discount)
Tiered Discount
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
A store applies exactly one discount tier based on original price : below the discount is zero; from to below it is ; from onward it is . Compute the amount payable. Discounts are not cumulative.
Input
One integer is the original price.
Output
Print one integer: the amount to pay.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
500
Output
450
Explanation
Price belongs to the last tier including its lower boundary. The single discount is , so the payment is .