f | from math import sqrt | f | from math import sqrt |
| | | |
| | | |
n | def isInt(a): | n | def isInt(n): |
| return int(a) == float(a) | | return int(n) == float(n) |
| | | |
| | | |
n | def iscube(a): | n | def iscube(n): |
| is_it = False | | is_it = False |
n | for b in range(int(a**(1/3)), int(4*(a**(1/3)))): | n | for m in range(int(n**(1/3)), int(4*(n**(1/3)))): |
| if a % b == 0: | | if n % m == 0: |
| is_int = b*b - 4*(b*b - a/b)/3 | | is_int = m*m - 4*(m*m - n/m)/3 |
| if is_int >= 0: | | if is_int >= 0: |
| is_int = sqrt(is_int) | | is_int = sqrt(is_int) |
| if isInt(is_int): | | if isInt(is_int): |
| return "YES" | | return "YES" |
| | | |
| return "NO" | | return "NO" |
| | | |
| | | |
t | n = int(input()) | t | num = int(input()) |
| print(iscube(n)) | | print(iscube(num)) |
| | | |