#P6933. [ICPC2017 WF] Need for Speed
[ICPC2017 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
题目大意
在你面前的是一个坏掉的速度表,当显示速度为 km/h 时,实际速度为 km/h, 为固定的常数,为任意实数。你打算计算这个 ,于是准备用这个速度表记录速度。现在你要走 段路程,第 段路程距离为 米,显示的指数为 km/h,总共路程用了 小时。求 的值。
你的答案应该与正确答案的差在 以内。
,,,。
翻译者:一只书虫仔
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: