#abc363a. A - Piling Up
A - Piling Up
Score : points
问题陈述
在AtCoder中,用户的评分是一个正整数,并且根据这个值,会显示一定数量的^
。具体来说,当评分在到之间(包括和)时,显示规则如下:
- 当评分在到之间(包括和),显示一次
^
。 - 当评分在到之间(包括和),显示两次
^
。 - 当评分在到之间(包括和),显示三次
^
。 - 当评分在到之间(包括和),显示四次
^
。
目前,高桥的评分是。这里,保证是一个在到之间(包括和)的整数。
找出他需要增加的最小评分,以增加显示的^
的数量。
可以证明,在这个问题的约束条件下,他可以在不将评分提高到或以上的情况下增加^
的数量。
以上为大语言模型 kimi 翻译,仅供参考。
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:
Output
Print, as an integer, the minimum increase in rating required for Takahashi to increase the number of displayed ^
.
Sample Input 1
123
Sample Output 1
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 .
Sample Input 2
250
Sample Output 2
50