CF1359F.RC Kaboom Show
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You know, it's hard to conduct a show with lots of participants and spectators at the same place nowadays. Still, you are not giving up on your dream to make a car crash showcase! You decided to replace the real cars with remote controlled ones, call the event "Remote Control Kaboom Show" and stream everything online.
For the preparation you arranged an arena — an infinite 2D-field. You also bought n remote controlled cars and set them up on the arena. Unfortunately, the cars you bought can only go forward without turning left, right or around. So you additionally put the cars in the direction you want them to go.
To be formal, for each car i ( 1≤i≤n ) you chose its initial position ( xi,yi ) and a direction vector ( dxi,dyi ). Moreover, each car has a constant speed si units per second. So after car i is launched, it stars moving from ( xi,yi ) in the direction ( dxi,dyi ) with constant speed si .
The goal of the show is to create a car collision as fast as possible! You noted that launching every car at the beginning of the show often fails to produce any collisions at all. Thus, you plan to launch the i -th car at some moment ti . You haven't chosen ti , that's yet to be decided. Note that it's not necessary for ti to be integer and ti is allowed to be equal to tj for any i,j .
The show starts at time 0 . The show ends when two cars i and j ( i=j ) collide (i. e. come to the same coordinate at the same time). The duration of the show is the time between the start and the end.
What's the fastest crash you can arrange by choosing all ti ? If it's possible to arrange a crash then print the shortest possible duration of the show. Otherwise, report that it's impossible.
输入格式
The first line contains a single integer n ( 1≤n≤25000 ) — the number of cars.
Each of the next n lines contains five integers xi , yi , dxi , dyi , si ( −103≤xi,yi≤103 ; 1≤∣dxi∣≤103 ; 1≤∣dyi∣≤103 ; 1≤si≤103 ) — the initial position of the i -th car, its direction vector and its speed, respectively.
It's guaranteed that all cars start at distinct positions (i. e. (xi,yi)=(xj,yj) for i=j ).
输出格式
Print the shortest possible duration of the show if it's possible to arrange a crash by choosing all ti . Otherwise, print "No show :(".
Your answer is considered correct if its absolute or relative error does not exceed 10−6 .
Formally, let your answer be a , and the jury's answer be b . Your answer is accepted if and only if max(1,∣b∣)∣a−b∣≤10−6 .
输入输出样例
输入#1
4 3 -1 -1 1 2 2 3 -3 -2 10 -4 2 1 -2 1 -2 -2 -1 2 4
输出#1
0.585902082262898
输入#2
2 -1 1 -1 1 200 1 1 1 5 200
输出#2
No show :(
说明/提示
Here is the picture for the first example:
The fastest cars to crash are cars 2 and 4 . Let's launch car 2 at 0 , car 4 at about 0.096762 and cars 1 and 3 at arbitrary time. That way cars 2 and 4 will crash into each other at about 0.585902 . So here's what it looks like at the moment of the collision:
Here's the picture for the second example: