Problem B: 求解方程
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:108
Solved:12
Description
求解方程:
a1/(x+b1) + a2/(x+b2) + ... ... + an/(x+bn) = C,(x+bi>0)
例如:以下方程解 x = 3.000000。
4/(x-1) + 4/x + 10/(x+3)=5
Input
输入的第一行包含两个整数 n(1≤n≤1000) 和 C(1≤C≤106)。
接下来有 n 行,每行包含两个整数ai (1≤ai≤1000) 和 bi(-1000≤bi≤1000)。
Output
输出x的解,答案的绝对误差或相对误差应小于 10−6 。
Sample Input Copy
4 10
5 3
2 2
3 6
3 1
Sample Output Copy
-0.508653
HINT
注意:不要输出 -0