A - Piling Up Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 100100

問題文

AtCoder では、ユーザーのレートは正の整数で与えられ、その値に応じて ^ がいくつか表示されます。 特に、レートが 11 以上 399399 以下のときは次のようになります。

  • レートが 11 以上 9999 以下のときは ^11 個表示される。
  • レートが 100100 以上 199199 以下のときは ^22 個表示される。
  • レートが 200200 以上 299299 以下のときは ^33 個表示される。
  • レートが 300300 以上 399399 以下のときは ^44 個表示される。

現在の高橋君のレートは RR です。ここで、RR11 以上 299299 以下の整数であることが保証されます。
表示される ^ の数を現在より増やすために、高橋君は少なくともレートをいくつ上げる必要があるか答えてください。
なお、本問題の制約下で、高橋君はレートを 400400 以上に上げることなく ^ の数を増やすことができることが証明できます。

制約

  • 1R2991\leq R \leq 299
  • RR は整数

入力

入力は以下の形式で標準入力から与えられる。

RR

出力

表示される ^ の数を現在より増やすために、高橋君は少なくともレートをいくつ上げる必要があるか整数で出力せよ。


入力例 1Copy

Copy
123

出力例 1Copy

Copy
77

高橋君の現在のレートは 123123 であり、^22 個表示されています。
ここからレートを 7777 上げると高橋君のレートは 200200 となり、^33 個表示されるようになります。 レート が 199199 以下のときは ^ の数は 22 個以下であるので、7777 を出力します。


入力例 2Copy

Copy
250

出力例 2Copy

Copy
50

Score : 100100 points

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 11 and 399399, inclusive, the display rules are as follows:

  • When the rating is between 11 and 9999, inclusive, ^ is displayed once.
  • When the rating is between 100100 and 199199, inclusive, ^ is displayed twice.
  • When the rating is between 200200 and 299299, inclusive, ^ is displayed three times.
  • When the rating is between 300300 and 399399, inclusive, ^ is displayed four times.

Currently, Takahashi's rating is RR. Here, it is guaranteed that RR is an integer between 11 and 299299, 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 400400 or above.

Constraints

  • 1R2991 \leq R \leq 299
  • RR is an integer.

Input

The input is given from Standard Input in the following format:

RR

Output

Print, as an integer, the minimum increase in rating required for Takahashi to increase the number of displayed ^.


Sample Input 1Copy

Copy
123

Sample Output 1Copy

Copy
77

Takahashi's current rating is 123123, and ^ is displayed twice.
By increasing his rating by 7777, his rating will become 200200, and ^ will be displayed three times. When the rating is 199199 or below, ^ is displayed not more than twice, so print 7777.


Sample Input 2Copy

Copy
250

Sample Output 2Copy

Copy
50


2025-04-01 (Tue)
15:14:35 +00:00