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

34453번 - Additive Primes 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB46383280.000%

문제

A prime number is an integer $n$ ($n \ge 2$) such that $n$ cannot be formed as the product of two other integers smaller than $n$. In other words, a number is prime if its factors are only one and itself. An integer which is greater than 2ドル$ and is not prime is called a composite number.

An additive prime in base-10ドル$ is a number which is both prime and the sum of its digits forms a prime number. For example, 23ドル$ is an additive prime, since 23ドル$ is prime, and 2ドル + 3 = 5$ is also prime, but 13ドル$ is not, since 1ドル + 3 = 4,ドル and 4ドル$ is not prime.

입력

Input consists of a single integer $n$ (2ドル \le n \le 2^{31} - 1$).

출력

Output "ADDITIVE PRIME" if the number is an additive prime. Output "PRIME, BUT NOT ADDITIVE" if the number is prime, but not an additive prime. Output "COMPOSITE" otherwise.

제한

예제 입력 1

61

예제 출력 1

ADDITIVE PRIME

예제 입력 2

17

예제 출력 2

PRIME, BUT NOT ADDITIVE

예제 입력 3

141

예제 출력 3

COMPOSITE

노트

출처

School > CS@Mines > CS@Mines HSPC 2018 H번

  • 문제를 만든 사람: Jack Rosenthal
(追記) (追記ここまで)

출처

대학교 대회

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

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