There are
Find the proportion of pie obtained by each person after all operations are performed.
Constraints
Input Specification
The first line contains two space-separated integers,
The
Output Specification
Output
Your answer will be accepted if every value is within an absolute error of
Sample Input 1
Copy
3 3
3 13
1 90
3 95
Sample Output 1
Copy
0.783000
0.000000
0.212650
Explanation for Sample 1
Initially, the remaining pie is
- In the 1st operation, person
got proportion of pie, and the remaining pie is . - In the 2nd operation, person
got proportion of pie, and the remaining pie is . - In the 3rd operation, person
got proportion of pie.
In total, person
Sample Input 2
Copy
3 5
2 20
3 50
1 40
2 30
3 20
Sample Output 2
Copy
0.160000
0.272000
0.433600
Comments