CF594B.Max and Bike
省选/NOI-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 < 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 < 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.

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.
数月以来,马克西姆一直骑着他最喜爱的自行车上班。最近,他决定自己已经准备好参加自行车比赛了。
他知道今年将举行 n 场比赛。在第 i 场比赛中,参赛者必须尽快沿一条直线从起点 si 骑行至终点 fi(其中 si<fi)。
计时是一个复杂的过程,涉及一种特殊传感器和一个计时器。我们将自行车前轮视为一个半径为 r 的圆。忽略轮胎厚度、传感器尺寸以及所有物理效应。传感器被安装在车轮轮缘上,即固定于半径为 r 的圆周上的某个点。此后,计时器的运动方式与该圆周上选定的点完全一致:既向前平移,又绕圆心旋转。
每位参赛者在起跑前均可自由选择初始位置 bi,要求其自行车完全位于起跑线后方,即满足 bi<si−r。随后,他立即启动并瞬间加速至其最大速度 v;当传感器坐标恰好等于起点坐标 si 时(记此时刻为 tsi),计时器开始计时。参赛者以最大速度 v 完成全程骑行;当传感器坐标恰好等于终点坐标 fi 时(记此时刻为 tfi),计时器停止并记录最终用时。因此,计时器记录的完成时间为 tfi−tsi。

马克西姆数学功底扎实,他怀疑最终成绩不仅取决于他的最大速度 v,还与其初始位置 bi 的选择有关。现在,马克西姆请你为这 n 场比赛中的每一场,计算计时器所能测得的最短可能时间。他所用自行车车轮的半径为 r。
输入格式
The first line contains three integers n, r and v (1 ≤ n ≤ 100 000, 1 ≤ r, v ≤ 109) — 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 < f__i ≤ 109) — the coordinate of the start and the coordinate of the finish on the i-th competition.
第一行包含三个整数 n、r 和 v(1 ≤ n ≤ 100000,1 ≤ r,v ≤ 109),分别表示比赛的场数、Max 自行车前轮的半径以及他的最大速度。
接下来 n 行描述各场比赛。第 i 行包含两个整数 si 和 fi(1 ≤ si < fi ≤ 109),分别表示第 i 场比赛中起点和终点的坐标。
输出格式
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
.
输出 n 个实数,其中第 i 个数应等于时间计数器所能测得的最小可能时间。若你的答案的绝对误差或相对误差不超过 10−6,则视为正确。
具体而言:假设你的答案为 a,评测组的标准答案为 b。当满足
时,评测程序将判定你的答案正确。
输入输出样例
输入#1
2 1 2 1 10 5 9
输出#1
3.849644710502 1.106060157705
输入解题思路,AI测评打分。不知道怎么写?