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).
InputThe 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).
OutputFor 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).
ExamplesInput2Output
1
2
Case #1: 1Note
Case #2: 0
Fun fact: 1 is neither prime nor composite number.