atcoder#ABC223C. [ABC223C] Doukasen
[ABC223C] Doukasen
Score : points
Problem Statement
We have fuses connected in series. The -th fuse from the left has a length of centimeters and burns at a constant speed of centimeters per second.
Consider igniting this object from left and right ends simultaneously. Find the distance between the position where the two flames will meet and the left end of the object.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the distance between the position where the two flames will meet and the left end of the object, in centimeters (print just the number).
Your output will be considered correct when its absolute or relative error from our answer is at most .
3
1 1
2 1
3 1
3.000000000000000
The two flames will meet at centimeters from the left end of the object.
3
1 3
2 2
3 1
3.833333333333333
5
3 9
1 2
4 6
1 5
5 3
8.916666666666668