#P6933. [ICPC 2017 WF] Need for Speed
[ICPC 2017 WF] Need for Speed
题目描述

Sheila is a student and she drives at ypical student car: it is old, slow, rusty, and falling apart. Recently,the needle on the speedometer fell off. She glued it back on, but she might have placed it at the wrong angle. Thus, when the speedometer reads ,her true speed is , where is an unknown constant(possibly negative).
Sheila made a careful record of a recent journey and wants to use this to compute . The journey consisted of segments. In the segment she traveled a distance of and the speedometer read for the entire segment. This whole journey took time . Help Sheila by computing .
Note that while Sheila's speedometer might have negative readings, her true speed was greater than zero for each segment of the journey.
输入格式
The first line of input contains two integers , the number of sections in Sheila's journey, and the total time. This is followed by lines, each describing one segment of Sheila's journey. The of these lines contains two integers and , the distance and speedometer reading for the segment of the journey. Time is specified in hours, distance in miles, and speed in miles per hour.
输出格式
Display the constant in miles per hour. Your answer should have an absolute or relative error of less than
3 5
4 -1
4 0
10 3
3.000000000
4 10
5 3
2 2
3 6
3 1
-0.508653377
提示
Time limit: 1 s, Memory limit: 512 MB.
spj provider: