# Programmer: Sriram Pemmaraju # Date: Feb 13, 2015 # Get input s = float(input()) eps = float(input()) # Initialize the first two terms x_0 and x_1 oldX = s/2 newX = (oldX + s/oldX)/2 # Repeatedly construct x_i from x_{i-1} using the formula in the handout. # Do this while two consecutive terms are far from each other while abs(oldX - newX) > eps: oldX = newX newX = (oldX + s/oldX)/2 print(newX)