John is learning number theory. His first lesson is about prime numbers. Like everyone, he loves prime numbers. Unlike everyone, he started trying to generalize the idea of prime numbers. He first tried to generalize the idea of prime numbers to a pair of number (a,b). To generalize he needed to define addition and multiplication. He defined addition and multiplication and a function abs() in following way, For example, (a1, b1) + (a2, b2) = (a,b)∗(a,b) = (a1+b1,a2+b2) (a ∗a −b ∗b,a ∗b +a ∗b) 1 1 2 2 √1 2 1 2 1 2 2 1 (a2 + b2) abs((a, b)) = He proved that if z1, z2 and z3 are pair of numbers then, (p1, q1) + (p2, q2) = (p,q)∗(p,q) = (p1+q1,p2+q2) (p ∗p −q ∗q,p ∗q +p ∗q) 1 1 2 2 √1 2 1 2 1 2 2 1 abs(p)2 + abs(q)2) z1∗z2 = z1∗(z2+z3) = abs(z1∗z2) = z2∗z1 z1 ∗z2 +z1 ∗z3 abs(z1 ) ∗ abs(z2 ) He says a pair of number to be prime if it cannot be written as a multiplication of two integer pair of numbers both having absolute value greater than 1. So (2, 1) is prime while (5, 5) = (2, 1) * (3,1) is not. Note that in this system prime factorization is not necessarily unique. As an example (5, 0) = (1, 2) * (1, 2) = (2, 1) * (2, -1). The absolute value of (3, 4) is abs((3,4)) = 5. He wants to extend the idea further. He says a pair of pair or quad (p,q) where both p and q are pair of integer. Multiplication, addition and absolute value are defined as below. abs((p, q)) = ((1, 2), (3, 4)) + ((5, 6), (7, 8)) = ((6, 8), (10, 12)) ((1, 2), (3, 4)) ∗ ((5, 6), (7, 8)) = ((1, 2) ∗ (5, 6) − (3, 4) ∗ (7, 8), (1, 2) ∗ (7, 8) + (3, 4) ∗ (5, 6)) = ((−7, 16) − (−11, 52), (−9, 22) + (−9, 38)) = ((4, −36), (−18, 60)) He proved that if z1, z2 and z3 are quads then, z1∗z2 = z1∗(z2+z3) = abs(z1∗z2) = z2∗z1 z1 ∗z2 +z1 ∗z3 abs(z1 ) ∗ abs(z2 ) Again he will say a quad (p, q) to be integer if both p and q are integer pairs. A quad is said to be prime if it cannot be written as multiplication of two quads both having absolute value greater than 1. For example, ( (4, -36) , (18, 60) ) is not a prime while ( (5,2), (1,1) ) is. Johnsaysarealnumberxtobecoolifthereisaquadzsuchthatzisprimeandabs(z)=x. So √√ (31) is cool as abs(((5, 2), (1, 1))) = 31. John is wondering how many cool numbers are there which are not greater than a certain number.
2/2 Input The first line of input will contain T (≤ 1000) denoting the number of cases. Each case starts with a line containing an integer n (0 < n < 104). Output For each case, print the case number and the number of cool numbers not greater than n. Sample Input 2 2 4 Sample Output Case 1: 2 Case 2: 6