AtCoder Beginner Contest 206(Sponsored by Panasonic)
翻译中…
Problem Statement
翻译中…
AtCoDeer has an empty piggy bank.
On the morning of the $i$-th day, he will put $i$ yen (Japanese currency) in it: $1$ yen on the morning of the $1$-st day, $2$ yen on the morning of the $2$-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 $N$ yen or more for the first time?
翻译中…
Constraints
翻译中…
$1 \le N \le 10^9$$N$is an integer.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Print an integer $x$ such that AtCoDeer will find out that his piggy bank has $N$ yen or more for the first time on the $x$-th day.
翻译中…
样例
Input #1
12
Output #1
5
- On the $1$-st day, the piggy bank gets $1$ yen in the morning and has $1$ yen at night.
- On the $2$-st day, the piggy bank gets $2$ yen in the morning and has $3$ yen at night.
- On the $3$-rd day, the piggy bank gets $3$ yen in the morning and has $6$ yen at night.
- On the $4$-th day, the piggy bank gets $4$ yen in the morning and has $10$ yen at night.
- On the $5$-th day, the piggy bank gets $5$ yen in the morning and has $15$ yen at night.
Thus, on the $5$-th night, AtCoDeer will find out that his piggy bank has $12$ yen or more for the first time.
Input #2
100128
Output #2
447
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。