You are given N ratios in the form of A and B that is represented as AB. The values of A and B are represented as double data type values. The values of B are incorrect. The actual values of B are B+R. You know the actual sum of all the ratios that is available in variable K.
Note: The true values of B, represented as (B+R), are always greater than 0. Your task is to determine the value of R.
Input format
Output format
Print the value of R. Your answer must contain an absolute or relative error of less than 10−6.
Constraints
1≤N≤1000
1≤A≤1000
|B|≤1000
1≤K≤106
If the value of R is 3.00 then the actual values of B is 2,3,6. Thus, the sum of all ratios =(4/2+4/3+10/6)=5.