Preparando MOJI

Prime Segment

2000ms 65536K

Description:

Positive integer number x is called prime, if it has exactly two positive integer divisors. For example, 2, 3, 17, 97 are primes, but 1, 10, 120 are not.

You are given an integer number n, find the shortest segment [a, b], which contains n (i.e. a ≤ n ≤ b) and a, b are primes.

Input:

The only given line contains an integer number n (2 ≤ n ≤ 10000).

Output:

Print the space separated pair of the required numbers a, b.

Sample Input:

10

Sample Output:

7 11

Sample Input:

97

Sample Output:

97 97

Informação

Codeforces

Provedor Codeforces

Código CF64E

Tags

*specialbrute forcemathnumber theory

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 08:29:51

Relacionados

Nada ainda