eolymp
bolt
Try our new interface for solving problems
Problems

Diagonal

Diagonal

The number of diagonals of an $n$-gon is not less than $N$. What is the minimum possible value of $n$? \includegraphics{https://static.e-olymp.com/content/2d/2dd105fff1e3d9d300d46d879801e0b2c15de403.jpg} \InputFile Contains less than $1001$ lines. Each line contains a positive integer $N~(N \le 10^{15})$ that indicates the minimum possible number of diagonals. Input is terminated by a line with one $0$ that should not be processed. \OutputFile For each test case produce one line that contains serial number and the minimum possible value for $n$ (number of sides).
Time limit 1 second
Memory limit 128 MiB
Input example #1
10
100
1000
0
Output example #1
Case 1: 7
Case 2: 16
Case 3: 47