Piling Up
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Problem Statement
In AtCoder, a user's rating is given as a positive integer, and based on this value, a certain number of ^ is displayed. Specifically, when the rating is between and , inclusive, the display rules are as follows:
- When the rating is between and , inclusive,
^is displayed once. - When the rating is between and , inclusive,
^is displayed twice. - When the rating is between and , inclusive,
^is displayed three times. - When the rating is between and , inclusive,
^is displayed four times.
Currently, Takahashi's rating is . Here, it is guaranteed that is an integer between and , inclusive.
Find the minimum increase in rating required for him to increase the number of displayed ^.
It can be proved that under the constraints of this problem, he can increase the number of ^ without raising his rating to or above.
Constraints
- is an integer.
Input
The input is given from Standard Input in the following format:
R
Output
Print, as an integer, the minimum increase in rating required for Takahashi to increase the number of displayed ^.
Sample
123
77
Takahashi's current rating is , and ^ is displayed twice.
By increasing his rating by , his rating will become , and ^ will be displayed three times. When the rating is or below, ^ is displayed not more than twice, so print .
250
50
Programming exercise on 11 August
- 状态
- 已结束
- 规则
- IOI
- 题目
- 4
- 开始于
- 2024-8-11 16:30
- 结束于
- 2024-8-11 17:30
- 持续时间
- 1 小时
- 主持人
- 参赛人数
- 2