MaxPrime/abrivan | MaxPrime/Stephan | ||||
---|---|---|---|---|---|
n | 1 | def prime(k): | n | 1 | def prime(a): |
2 | for j in range(2, int(k**0.5)+1): | 2 | for x in range(2, int(a**0.5)+1): | ||
3 | if k % j == 0: | 3 | if a % x == 0: | ||
4 | return False | 4 | return False | ||
5 | 5 | ||||
6 | return True | 6 | return True | ||
7 | 7 | ||||
8 | 8 | ||||
n | 9 | num = int(input()) | n | 9 | n = int(input()) |
10 | 10 | ||||
n | 11 | while not prime(num): | n | 11 | while not prime(n): |
12 | num -= 1 | 12 | n -= 1 | ||
13 | 13 | ||||
t | 14 | print(num) | t | 14 | print(n) |
15 | 15 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|