#C12197. Largest Prime Finder
Largest Prime Finder
Largest Prime Finder
In this problem, you are given an integer ( n ) and you need to find the largest prime number that is less than or equal to ( n ). A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself (i.e. ( p > 1 ) and its only divisors are 1 and ( p )). If there is no prime number that meets the criteria, output None
.
inputFormat
The input consists of a single integer ( n ) provided via standard input.
outputFormat
Output the largest prime number less than or equal to ( n ). If no such prime exists, output None
(without quotes).## sample
10
7