def sqrt(a):
if a < 0:
return -1
i, j = 0, a
while i<= j:
mid = (i+j)/2
if abs(mid**2-a)<=0.01:
return mid
elif mid**2-a>0.01:
j = mid
else:
i = mid
def sqrt(a):
if a < 0:
return -1
i, j = 0, a
while i<= j:
mid = (i+j)/2
if abs(mid**2-a)<=0.01:
return mid
elif mid**2-a>0.01:
j = mid
else:
i = mid