CF198C.Delivering Carcinogen
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Qwerty the Ranger arrived to the Diatar system with a very important task. He should deliver a special carcinogen for scientific research to planet Persephone. This is urgent, so Qwerty has to get to the planet as soon as possible. A lost day may fail negotiations as nobody is going to pay for an overdue carcinogen.
You can consider Qwerty's ship, the planet Persephone and the star Diatar points on a plane. Diatar is located in the origin of coordinate axes — at point (0, 0). Persephone goes round Diatar along a circular orbit with radius R in the counter-clockwise direction at constant linear speed v__p (thus, for instance, a full circle around the star takes
of time). At the initial moment of time Persephone is located at point (x__p, y__p).
At the initial moment of time Qwerty's ship is at point (x, y). Qwerty can move in any direction at speed of at most v (v > v__p). The star Diatar is hot (as all stars), so Qwerty can't get too close to it. The ship's metal sheathing melts at distance r (r < R) from the star.
Find the minimum time Qwerty needs to get the carcinogen to planet Persephone.
Qwerty 探险家抵达了迪亚塔尔(Diatar)星系,肩负一项极其重要的任务:他需将一种特殊的致癌物运送到行星珀耳塞福涅(Persephone),以供科学研究之用。此事十万火急,Qwerty 必须尽快抵达该行星。哪怕延误一天,谈判也可能失败——毕竟,没人愿意为逾期交付的致癌物付款。
你可以将 Qwerty 的飞船、行星珀耳塞福涅以及恒星迪亚塔尔均视为平面上的点。恒星迪亚塔尔位于坐标系原点,即点 (0,0)。珀耳塞福涅围绕迪亚塔尔沿半径为 R 的圆形轨道作逆时针匀速圆周运动,其线速度为 vp(因此,绕恒星运行一周所需时间为
)。在初始时刻,珀耳塞福涅位于点 (xp,yp)。
在初始时刻,Qwerty 的飞船位于点 (x,y)。Qwerty 可朝任意方向移动,最大速度为 v(其中 v>vp)。恒星迪亚塔尔温度极高(正如所有恒星一样),因此 Qwerty 无法过于靠近它;当飞船与恒星之间的距离小于 r(其中 r<R)时,船体金属外壳便会熔化。
求 Qwerty 将致癌物送达行星珀耳塞福涅所需的最短时间。
输入格式
The first line contains space-separated integers x__p, y__p and v__p ( - 104 ≤ x__p, y__p ≤ 104, 1 ≤ v__p < 104) — Persephone's initial position and the speed at which it goes round Diatar.
The second line contains space-separated integers x, y, v and r ( - 104 ≤ x, y ≤ 104, 1 < v ≤ 104, 1 ≤ r ≤ 104) — The intial position of Qwerty's ship, its maximum speed and the minimum safe distance to star Diatar.
It is guaranteed that _r_2 < _x_2 + _y_2, _r_2 < _x__p_2 + _y__p_2 and v__p < v.
第一行包含用空格分隔的整数 xp、yp 和 vp(−104≤xp,yp≤104,1≤vp<104)——珀耳塞福涅的初始位置及其绕恒星迪亚塔尔运行的速度。
第二行包含用空格分隔的整数 x、y、v 和 r(−104≤x,y≤104,1<v≤104,1≤r≤104)——奎尔蒂飞船的初始位置、其最大速度以及到恒星迪亚塔尔的最小安全距离。
保证满足 r2<x2+y2、r2<xp2+yp2 以及 vp<v。
输出格式
Print a single real number — the minimum possible delivery time. The answer will be considered valid if its absolute or relative error does not exceed 10 - 6.
输出一个实数——最小可能的配送时间。若答案的绝对或相对误差不超过 10−6,则视为正确。
输入输出样例
输入#1
10 0 1 -10 0 2 8
输出#1
9.584544103
输入#2
50 60 10 50 60 20 40
输出#2
0.000000000
输入解题思路,AI测评打分。不知道怎么写?