Learn practical skills, build real-world projects, and advance your career
Updated 3 years ago
fg
Use the "Run" button to execute the code.
!pip install jovian --upgrade --quiet
import jovian
# Execute this to save new versions of the notebook
jovian.commit(project="fg")
import math
def perfectCube(N) :
# Iterate from 1-N
for i in range(N + 1) :
cube = i * i * i;
if (cube == N) :
return True;
return False
N=int(input())
P=input().split(' ')
P=[int(g) for g in P]
s=sum(P)
if perfectCube(s):
print("Yes")
else:
temp=(math.floor(s**(1/3)))+1
print((temp**3)-s)