MaxPrime/valerapon | MaxPrime/yervandsargsyan | ||||
---|---|---|---|---|---|
n | 1 | def isPrime(num): | n | 1 | def isprime(n): |
2 | for i in range(2, round(num ** 0.5) + 2): | 2 | for i in range(2, int(n**0.5)+1): | ||
3 | if num % i == 0: | 3 | if n % i == 0: | ||
4 | return False | 4 | return False | ||
n | n | 5 | |||
5 | return True | 6 | return True | ||
6 | 7 | ||||
7 | 8 | ||||
8 | num = int(input()) | 9 | num = int(input()) | ||
9 | 10 | ||||
n | 10 | while not isPrime(num): | n | 11 | while not isprime(num): |
11 | num -= 1 | 12 | num -= 1 | ||
t | t | 13 | |||
12 | print(num) | 14 | print(num) | ||
13 | 15 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|