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