401572: GYM100495 D Modulo maths

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Modulo mathstime limit per test0.25 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Birute loves modular arithmetics, but hates long problem statements.

Given n, find f(n).

Input

The first line contains the number of test cases T (T ≤ 50). In the following T lines there are integer values of number n (1 ≤ n ≤ 10007).

Output

For each test case output one line containing “Case #tc: num”, where tc is the number of the test case (starting from 1) and num is the value of f(n).

ExamplesInput
2
1
2
Output
Case #1: 1
Case #2: 0
Note

Fun fact: 1 is neither prime nor composite number.

加入题单

上一题 下一题 算法标签: