EQUU2 - Again Equation

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

You are given an integer P. You have to find the smallest positive integer of x(x>=0) 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<=9*1018).

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


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

hide comments
2014-03-07 17:00:31 Francky
Warning, here positive means >=0, not >0. It should be clearer in description, definition depend on country!
---
It is a tutorial task, moved.
===
Edit(Francky)--> I saw that modification of description is done. Fine. Usually, one can thanks for pointing 'errors', but rather not simply hide the comment. :-(
===
RE: Sorry & Thanks Francky. Actually I didn't hide your comment feeling bored or something else. I just did this thinking nothing. :)

Last edit: 2014-03-12 09:40:58
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.