Logo
(追記) (追記ここまで)

26355번 - Sorry About That, Chief! 다국어

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

문제

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)!

힌트

출처

University > University of Central Florida > 2011 Local Programming Contest 7번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /