#abc206b. B - Savings

B - Savings

Score : 200200 points

问题描述

AtCoDeer 有一个空的存钱罐。
在第 ii 天早晨,他会放入 ii 日元(日本货币):在第 11 天早晨放入 11 日元,在第 22 天早晨放入 22 日元,依此类推。
每天晚上,他都会检查存钱罐中的金额。
在第几天他会首次发现存钱罐中有 NN 日元或更多?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

AtCoDeer has an empty piggy bank.
On the morning of the ii-th day, he will put ii yen (Japanese currency) in it: 11 yen on the morning of the 11-st day, 22 yen on the morning of the 22-nd day, and so on.
Each night, he will check the amount of money in it.
On which day will he find out that his piggy bank has NN yen or more for the first time?

Constraints

  • 1N1091 \le N \le 10^9
  • NN is an integer.

Input

Input is given from Standard Input in the following format:

NN

Output

Print an integer xx such that AtCoDeer will find out that his piggy bank has NN yen or more for the first time on the xx-th day.

Sample Input 1

12

Sample Output 1

5
  • On the 11-st day, the piggy bank gets 11 yen in the morning and has 11 yen at night.
  • On the 22-st day, the piggy bank gets 22 yen in the morning and has 33 yen at night.
  • On the 33-rd day, the piggy bank gets 33 yen in the morning and has 66 yen at night.
  • On the 44-th day, the piggy bank gets 44 yen in the morning and has 1010 yen at night.
  • On the 55-th day, the piggy bank gets 55 yen in the morning and has 1515 yen at night.

Thus, on the 55-th night, AtCoDeer will find out that his piggy bank has 1212 yen or more for the first time.

Sample Input 2

100128

Sample Output 2

447

update @ 2024/3/10 09:19:14