| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 31 | 15 | 9 | 40.909% |
Andrew started playing a new multiplayer online game. He needs to create a flag to be different from other players.
Andrew decided that there should be $n$ stars on the flag forming a figure just like on the US one:
Andrew doesn't want the flag to be too long or too wide, so he is interested in the minimum possible absolute difference of the number of rows and the maximum number of stars in a row.
The only line of input contains an integer $n$ --- the number of stars ($1 \le n \le 10^{12}$).
Output a single integer --- the minimum possible absolute difference of the number of rows and the maximum number of stars in a row.
1
0
2
1
3
0
50
3
An example of the optimal arrangement of the stars in the fourth test case: