Savings

AtCoder
IDabc206_b
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
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
API Response (JSON)
{
  "problem": {
    "name": "Savings",
    "description": {
      "content": "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 d",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc206_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "AtCoDeer has an empty piggy bank.  \nOn 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 d...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments