-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path588B.py
More file actions
39 lines (30 loc) · 784 Bytes
/
588B.py
File metadata and controls
39 lines (30 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# @author Matheus Alves dos Santos
import math
divisors = []
answer = 1
i = 0
number = int(input())
sqrt = int(math.floor(math.sqrt(number)))
for j in range(1, sqrt + 1):
if ((number % j) == 0):
divisors.append(j)
divisors.append(number // j)
divisors.sort(reverse = True)
while (True):
sqrt = math.sqrt(divisors[i])
if ((sqrt % 1) == 0):
i += 1
bln = True
last = divisors[i]
sqrt = int(math.sqrt(last))
for j in range(2, sqrt + 1):
if ((last % j) == 0):
if ((math.sqrt(last // j) % 1 == 0) or ((math.sqrt(j) % 1) == 0)):
bln = False
break
if (bln):
answer = last
break
else:
i += 1
print(int(answer))