EQU1 - Equation

no tags 

Let us define f(x) =3x2+2x+7.

You are given an integer P. You have to find the smallest positive integer of x such that f(x) ≥P.

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case contains an integer P (1<=P<=1010).

Output

For each test case, print the case number and the required answer.

Sample Input

Output for Sample Input

2

92

91

Case 1: 5

Case 2: 5

 

Problem Setter: Md Abdul Alim, Dept. of Computer Science, Bangladesh University of Business & Technology

 


hide comments
tomas: 2014-07-07 01:10:29

be careful!
0 is not a positive integer but the author consider it is.


Added by:Alim
Date:2014-03-03
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU
Resource:Own Problem