303050: CF594B. Max and Bike

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Max and Bike

题意翻译

几个月以来,Maxim 一直致力于他最喜欢的自行车工作。最近,他决定参加自行车比赛。 他知道今年将举办 $n$ 场比赛。在第 $i$ 场比赛中,参赛者必须尽快完成从 $s_i$ 点到 $f_i$ 点的直线行驶($s_i < f_i$)。 测量时间是一个与特殊传感器和计时器有关的复杂过程。自行车的前轮可以视为半径为 $r$ 的圆;轮胎的厚度,传感器的尺寸以及所有物理影响均忽略不计。传感器放置在车轮的轮辋上,即位于半径 $r$ 的圆上的某个固定点上。之后,计数器就像圆的选定点一样移动,即向前移动并绕圆的中心旋转。 在开始时,每个参与者都可以选择任何一个点 $b_i$,以使他的自行车完全落后于起跑线,即 $b_i < s_i - r$。此后,他开始运动,立即加速到最大速度,在时间 $ts_i$,当传感器的坐标等于开始的坐标时,计时器启动。骑自行车的人以最大的速度进行完整的骑行。当传感器的坐标等于终点的坐标时,计时器将停止计时并记录最终时间 $tf_i$。因此,计数器记录参与者在时间 $tf_i - ts_i$ 中完成了一次完整骑行。 Maxim 擅长数学,他怀疑总结果不仅取决于最大速度 $v$,还取决于初始点 $b_i$ 的选择。现在,Maxim 希望您为 $n$ 个比赛中的每一个计算骑行的最小可能时间。他的自行车车轮的半径等于 $r$。

题目描述

For months Maxim has been coming to work on his favorite bicycle. And quite recently he decided that he is ready to take part in a cyclists' competitions. He knows that this year $ n $ competitions will take place. During the $ i $ -th competition the participant must as quickly as possible complete a ride along a straight line from point $ s_{i} $ to point $ f_{i} $ ( $ s_{i}&lt;f_{i} $ ). Measuring time is a complex process related to usage of a special sensor and a time counter. Think of the front wheel of a bicycle as a circle of radius $ r $ . Let's neglect the thickness of a tire, the size of the sensor, and all physical effects. The sensor is placed on the rim of the wheel, that is, on some fixed point on a circle of radius $ r $ . After that the counter moves just like the chosen point of the circle, i.e. moves forward and rotates around the center of the circle. At the beginning each participant can choose any point $ b_{i} $ , such that his bike is fully behind the starting line, that is, $ b_{i}&lt;s_{i}-r $ . After that, he starts the movement, instantly accelerates to his maximum speed and at time $ ts_{i} $ , when the coordinate of the sensor is equal to the coordinate of the start, the time counter starts. The cyclist makes a complete ride, moving with his maximum speed and at the moment the sensor's coordinate is equal to the coordinate of the finish (moment of time $ tf_{i} $ ), the time counter deactivates and records the final time. Thus, the counter records that the participant made a complete ride in time $ tf_{i}-ts_{i} $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF594B/0da531a238dd82ea419c8ad0bc10a8e3fa696887.png)Maxim is good at math and he suspects that the total result doesn't only depend on his maximum speed $ v $ , but also on his choice of the initial point $ b_{i} $ . Now Maxim is asking you to calculate for each of $ n $ competitions the minimum possible time that can be measured by the time counter. The radius of the wheel of his bike is equal to $ r $ .

输入输出格式

输入格式


The first line contains three integers $ n $ , $ r $ and $ v $ ( $ 1<=n<=100000,1<=r,v<=10^{9} $ ) — the number of competitions, the radius of the front wheel of Max's bike and his maximum speed, respectively. Next $ n $ lines contain the descriptions of the contests. The $ i $ -th line contains two integers $ s_{i} $ and $ f_{i} $ ( $ 1<=s_{i}&lt;f_{i}<=10^{9} $ ) — the coordinate of the start and the coordinate of the finish on the $ i $ -th competition.

输出格式


Print $ n $ real numbers, the $ i $ -th number should be equal to the minimum possible time measured by the time counter. Your answer will be considered correct if its absolute or relative error will not exceed $ 10^{-6} $ . Namely: let's assume that your answer equals $ a $ , and the answer of the jury is $ b $ . The checker program will consider your answer correct if ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF594B/259203790d90e969d73ec841bd0673c1e8e7d69a.png).

输入输出样例

输入样例 #1

2 1 2
1 10
5 9

输出样例 #1

3.849644710502
1.106060157705

Input

题意翻译

几个月以来,Maxim 一直致力于他最喜欢的自行车工作。最近,他决定参加自行车比赛。 他知道今年将举办 $n$ 场比赛。在第 $i$ 场比赛中,参赛者必须尽快完成从 $s_i$ 点到 $f_i$ 点的直线行驶($s_i < f_i$)。 测量时间是一个与特殊传感器和计时器有关的复杂过程。自行车的前轮可以视为半径为 $r$ 的圆;轮胎的厚度,传感器的尺寸以及所有物理影响均忽略不计。传感器放置在车轮的轮辋上,即位于半径 $r$ 的圆上的某个固定点上。之后,计数器就像圆的选定点一样移动,即向前移动并绕圆的中心旋转。 在开始时,每个参与者都可以选择任何一个点 $b_i$,以使他的自行车完全落后于起跑线,即 $b_i < s_i - r$。此后,他开始运动,立即加速到最大速度,在时间 $ts_i$,当传感器的坐标等于开始的坐标时,计时器启动。骑自行车的人以最大的速度进行完整的骑行。当传感器的坐标等于终点的坐标时,计时器将停止计时并记录最终时间 $tf_i$。因此,计数器记录参与者在时间 $tf_i - ts_i$ 中完成了一次完整骑行。 Maxim 擅长数学,他怀疑总结果不仅取决于最大速度 $v$,还取决于初始点 $b_i$ 的选择。现在,Maxim 希望您为 $n$ 个比赛中的每一个计算骑行的最小可能时间。他的自行车车轮的半径等于 $r$。

加入题单

算法标签: