There are \(N\) people labeled from \(1\) to \(N\). You have a whole pie and will perform \(M\) operations. In the \(i^{th}\) operation, you will give \(p_i\%\) of the remaining pie to person \(a_i\).
Find the proportion of pie obtained by each person after all operations are performed.
Input
-
The first line contains two space-separated integers, \(N\) and \(M\).
-
The \(i^{th}\) of the following \(M\) lines contains two space-separated integers, \(a_i\) and \(p_i\).
Output
- Output \(N\) lines, where the \(i^{th}\) line contains a single number, representing the proportion of the pie obtained by person \(i\).
Your answer will be accepted if every value is within an absolute error of \(10^{-6}\).
Constraints
-
\(1 \le a_i \le N \le 100\)
-
\(1 \le M \le 100\)
-
\(0 \le p_i \le 100\)
Example
Test 1
Input
3 3
3 13
1 90
3 95
Output
0.783000
0.000000
0.212650
Note
Initially, the remaining pie is \(1.0\).
- In the 1st operation, person \(3\) got \(1.0\times 0.13 = 0.13\) proportion of pie, and the remaining pie is \(1-0.13=0.87\).
- In the 2nd operation, person \(1\) got \(0.87 \times 0.90 = 0.783\) proportion of pie, and the remaining pie is \(0.87-0.783=0.087\)
- In the 3rd operation, person \(3\) got \(0.087 \times 0.95=0.08265\) proportion of pie.
In total, person \(1\) got \(0.0.783\), person \(2\) got \(0\), and person \(3\) got \(0.13+0.08265=0.21265\) proportion of pie.
Test 2
Input
3 5
2 20
3 50
1 40
2 30
3 20
Output
0.160000
0.272000
0.433600
Bình luận
pls dịch to vietnamese, this web is from vietnam, i don't know english :(((