t=int(input())
for i in range(t):
    n=int(input())
    n=abs(n)
    cube=round(n**(1/3))
    if(cube**3 == n):
        print("YES")
    else:
        print("NO")    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: