#P180. 【例30.1】 平方根
【例30.1】 平方根
Description
In mathematics, the square of a number is defined as . The square root of a positive number is defined as all values of that satisfy .
Step 1: Let the initial solution ;
Step 2: Let
Step 3: Let
Step 4: Let
...
Step n: Let
When this process is carried out infinitely, the result will infinitely approach the true value. Of course, a computer cannot execute an infinite loop, so we can only find an approximate solution.
Given the number for which we want to find the square root and the number of iterations , please use this algorithm to find the approximate value of the square root of .
Input Format
The first line contains two integers () and (), as described in the problem.
Output Format
Output the approximate value of the square root of , rounded to three decimal places.
Sample
4 102.000