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

26505번 - O Fortuna 다국어

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

문제

In mathematics there are numbers that are fortunate, and some less fortunate. A fortunate number is defined as Q – P, where P is the product of the first N prime numbers (where N>1), and Q is the smallest prime greater than P+1. For example, if N = 2, P = 2*3 (the first two prime numbers), or 6. Q would be the smallest prime greater than 7, which is 11. Q – P is therefore 11 – 6, which is 5, another prime number. It has been conjectured by some mathematicians that this Fortunate number value will always be prime.

Likewise, a less fortunate number is defined as P – Q, using the same above scenario, except that Q is the largest prime less than P-1. Therefore, with N = 2, P again is 6, which makes Q = 3 (the largest prime less than 5), and so the LESS fortunate number in this case is 3. A similar conjecture for LESS fortunate numbers also asserts that they will always be prime.

입력

A row of integer values N in the range 1 < N <= 14.

출력

The original input value N, followed by the fortunate and less fortunate number, as described above, and shown below, with a single space separating each output item.

제한

예제 입력 1

2 3 4

예제 출력 1

N = 2 FORTUNATE = 5 LESS = 3
N = 3 FORTUNATE = 7 LESS = 7
N = 4 FORTUNATE = 13 LESS = 11

힌트

출처

School > PLU High School Programming Contest > PLU 2016 > Advanced 10번

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

출처

대학교 대회

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

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