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

33236번 - Heraldic Prediction 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 2048 MB89401837.500%

문제

After beating your friend Reyn in various games such as Chess, Backgammon, Checkers, and Battleships, you have almost managed to convince him that you possess the Monado -- a magic sword that lets you see the future. In an act of desparation, he offers you one last challenge. He will tell you a number $n$ between 1 and 10ドル^{16}$ and then secretly pick a prime number $p$ of any size. It will then be your job to tell him an even number $m,ドル where $n < m < n+50,ドル and $p^2 + m$ is a composite number (a composite number is a positive integer, which can be formed by multiplying two smaller positive integers). If both of those conditions are fulfilled, it will be clear that the future truly is yours to decide. Luckily, you suspect that Reyn might not have thought this game through very well, and that it is probably possible to determine an $m,ドル which adds up to a composite number with any possible value of $p$.

With this knowledge in mind, make a program that can beat Reyn, no matter what numbers he picks.

입력

The input consists of:

  • A line with a single integer $n$ (1ドル \leq n \leq 10^{16}$), the number chosen by Reyn.

출력

Output a single even number $m,ドル where $n < m < n+50$ and $p^2 + m$ is composite for any prime $p$.

If there are multiple valid solutions, you may output any one of them.

제한

예제 입력 1

5

예제 출력 1

26

예제 입력 2

4242

예제 출력 2

4256

힌트

출처

University > Delft University of Technology > Freshmen Programming Contest 2021 H번

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

출처

대학교 대회

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

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