| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 10 초 (추가 시간 없음) | 2048 MB | 74 | 45 | 40 | 60.606% |
Dave has just completed the Massive Open Online Course (MOOC) Cryptography on the popular website Coursera.org. Eager to create his own cryptography system -- against the advise of the teacher Dan Boneh to never, ever, ever implement your own crypto-system -- he searches for a SKP (Special Key Prime) A SKP is a prime that is preferably a large number, because the larger the number the more secure it is to use as a key. Remember that a prime is a number that is only divisible by 1 and itself. For example 2 is a prime because it's only divisible by 1 and 2. 15 however is not a prime since beside 1 and 15, also 3 and 5 happen to divide this number. The number 1 is considered to not be a prime.
Luckily his friend Trudy is quite good at guessing large numbers that could be prime. Your task is given a number by Trudy, to decide whether this is actually a prime or not.
You are given a number 0ドル \leq n \leq 10^{10},ドル the number that Trudy has guessed for Dave to use as a SKP.
You should output "SAFE" (without the quotes) iff the number $n$ is a prime, else your program should output "BROKEN" (again, without the quotes).
2
SAFE
15
BROKEN
104729
SAFE