提示: 欢迎访问OurACM平台。
Problem 1988 MathHomeWork

Accept: 115    Submit: 253
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Brother LYG has learned a new function called function “F(n)”, where F(n) equals to the number of factors of n(including 1 and n). For example, F(1) = 1, F(4) = 3…Now if you ask LYG to calculate F(n), he may soon tell you the answer. If you are evil enough and ask him about the sum of the first K F(i)( F(1) + F(2) + .. + F(K) = G(k)), I believe out superbrother LYG will soon tell you the answer too! However, an evil math teacher gives LYG one non-negative integer M, and want our superbrother to tell us if there exist one integer K such that G(k) = M.

Input

In the first line there is an integer T, indicates the number of test cases. (T <= 100) In each case, the first line contains only one integer M. (1 <= M <= 10^9).

Output

For each case, output “Case idx: “ first where idx is the index of the test case start from 1, then if there exist such integer K, just output K, otherwise just output “impossible!” instead!

Sample Input

3 1 2 3

Sample Output

Case 1: 1 Case 2: impossible! Case 3: 2

Source

FOJ有奖月赛-2010年11月

Submit  Back  Status  Discuss