시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB22514012265.241%

문제

.lilypond.org Along with some friends you formed the Band of Atonal Percussionists and Cellists. You have been playing for some years together, but you feel unsatisfied with the current level of play. Doing research into some interesting new styles, you are gripped by the intricate details of the world of jazz.

While of course you cannot apply all the new things you have learned immediately, you want to start with improvising some nice new rhythmic figures in the music your band plays. You will play a rhythm where every bar has n beats in it, but then you split up every beat into m notes. In total, you will have nm notes per bar.

Everyone in the band knows that there is no room for squares in jazz. So the number of notes in a bar should be squarefree. That is, there is no number k > 1 such that k2 divides the number of notes in a bar.

The percussionist has already suggested a number of beats per bar n; now it is up to you to find a number of notes per beat that does not leave any room for squares.

In the second sample we have n = 30 and m = 7. This works because 2 ≤ m < n and m × n = 210 has no divisor k2 for any k > 1.

입력

  • The input is a single squarefree integer 3 ≤ n ≤ 105.

출력

  • Output an integer 2 ≤ m < n such that m × n is still squarefree.

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

예제 입력 1

3

예제 출력 1

2

예제 입력 2

30

예제 출력 2

7

예제 입력 3

13

예제 출력 3

10

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2019 J번

  • 문제를 만든 사람: Ragnar Groot Koerkamp