시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB1371039476.423%

문제

When Dr. Orooji was your age, one of the popular TV shows was “Get Smart!” The main character in this show (Maxwell Smart, a secret agent) had a few phrases; we used one such phrase for the title of this problem and we’ll use couple more in the output!

A “prime” number is an integer greater than 1 with only two divisors: 1 and itself; examples include 5, 11 and 23. Given a positive integer, you are to print a message indicating whether the number is a prime or how close it is to a prime.

입력

The first input line contains a positive integer, n (n ≤ 100), indicating the number of values to check. The values are on the following n input lines, one per line. Each value will be an integer between 2 and 10,000 (inclusive).

출력

At the beginning of each test case, output “Input value: v” where v is the input value. Then, on the next output line, print one of the following two messages:

  • If the number is a prime, print “Would you believe it; it is a prime!”
  • If the number is not a prime, print “Missed it by that much (d)!” where d shows how close the number is to a prime number (note that the closest prime number may be smaller or larger than the given number).

Leave a blank line after the output for each test case. Follow the format illustrated in Sample Output.

예제 입력 1

4
23
25
22
10000

예제 출력 1

Input value: 23
Would you believe it; it is a prime!

Input value: 25
Missed it by that much (2)!

Input value: 22
Missed it by that much (1)!

Input value: 10000
Missed it by that much (7)!