#C7391. Largest Prime Number

    ID: 51257 Type: Default 1000ms 256MiB

Largest Prime Number

Largest Prime Number

In this problem, you are given an integer (n). Your task is to determine the largest prime number that is less than or equal to (n). If no such prime exists (i.e. when (n < 2)), you should output "None".

Recall that a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. You may use an efficient algorithm such as the Sieve of Eratosthenes to solve this problem. Make sure your output exactly matches the expected result.

inputFormat

The input consists of a single integer (n) provided via standard input (stdin).

outputFormat

Output the largest prime number less than or equal to (n) to standard output (stdout). If no prime number exists, output "None".## sample

10
7