def getroot(n,p):
dad = 1
uncle = n
root = 0
while dad <= uncle:
son = int(dad + (uncle-dad)/2)
if n*n == son:
return n
elif n*n > son:
dad = son+1
else:
uncle +=1
incr = 0.1
for i in range(p):
while root*root <=n:
root +=incr
root -=incr
incr = incr/10
return root
print(round(getroot(40,3),2))