300131: CF28E. DravDe saves the world
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
DravDe saves the world
题意翻译
## 题目描述 多么可怕啊!银河鸡帝国试图征服美丽的Z城,他们建造了一个巨大的孵化器,每天孵化出数百万只小鸡,然后用他们围住$Z$城。巨大的培养箱看起来像一个有$n$个顶点的平面上的多边形。很自然地,DravDe不能闲着,他想摧毁银河鸡帝国。当然,他会从孵化器入手。 DravDe现在在孵化器之外的$A(x_a,y_a)$点,并且想要进入孵化器杀死所有在里面工作的鸡。但是这需要他做很多事情!问题是,DravDe最近去滑旱冰,摔断了双腿. 他将乘坐自己的喷气式飞机LEVAP-41进入孵化器。 LEVAP-41以$V(x_v,y_v,z_v)$的速度高速飞行。DravDe可以在$A$点上飞机,飞一段时间,然后自己空降。DravDe很重,所以他的掉落速度是$F_{down}$, 但在每一次自由落体时,DravDe都能打开降落伞。从他打开伞的那一刻起,他就开始以$U(x_u,y_v,z_u)$的速度下落直到他着陆。不幸的是,DravDe不擅长数学,你会帮助这个贫穷世界的救世主DravDe设计一个方案,让他降落在孵化器的领土上吗? 如果答案不是唯一的,DravDe想要找到飞行时间最短的方案。如果答案仍然是不唯一的的,他希望在打开降落伞之前找到自由落体时间最短的那个。 ## 输入格式 第一行包含数字$n(3\le n \le10^4)$表示栅栏的定点数 接下来$n$行,每行两个整数$x_i$,$y_i$,表示这些顶点的坐标(以顺时针或逆时针的顺序),保证栅栏不包含自交点。 接下来四行包含这些点的坐标:$A(x_a,y_a)$, 速度$V(x_v,y_v,z_v)$,$F_{down}$和$U(x_u,y_u,z_u)$保证所有输入的数字都是整数,坐标的绝对值都不超过$10^4$;且$A$不在孵化器内 ## 输出格式 在第一行输出两个数字$t1,t2$,即如果DravDe在$t1$时空降(从飞行开始算起),他降落在孵化器的领土上(在边界上降落视为在领土上降落)。如果DravDe没有打开他的降落伞,$t2$应该等于DravDe下降的时间。如果DravDe无法到达孵化器区域,输出 -1 -1。如果答案不是唯一的,输出t1的最小值. 如果答案仍然是多个,输出$t2$的最小值。要求答案的误差小于$10^{-6}$题目描述
How horrible! The empire of galactic chickens tries to conquer a beautiful city «Z», they have built a huge incubator that produces millions of chicken soldiers a day, and fenced it around. The huge incubator looks like a poligon on the the plane $ Oxy $ with $ n $ vertices. Naturally, DravDe can't keep still, he wants to destroy the chicken empire. For sure, he will start with the incubator. DravDe is strictly outside the incubator's territory in point $ A(x_{a},y_{a}) $ , and wants to get inside and kill all the chickens working there. But it takes a lot of doing! The problem is that recently DravDe went roller skating and has broken both his legs. He will get to the incubator's territory in his jet airplane LEVAP-41. LEVAP-41 flies at speed $ V(x_{v},y_{v},z_{v}) $ . DravDe can get on the plane in point $ A $ , fly for some time, and then air drop himself. DravDe is very heavy, that's why he falls vertically at speed $ F_{down} $ , but in each point of his free fall DravDe can open his parachute, and from that moment he starts to fall at the wind speed $ U(x_{u},y_{u},z_{u}) $ until he lands. Unfortunately, DravDe isn't good at mathematics. Would you help poor world's saviour find such an air dropping plan, that allows him to land on the incubator's territory? If the answer is not unique, DravDe wants to find the plan with the minimum time of his flight on the plane. If the answers are still multiple, he wants to find the one with the minimum time of his free fall before opening his parachute输入输出格式
输入格式
The first line contains number $ n $ ( $ 3<=n<=10^{4} $ ) — amount of vertices of the fence. Then there follow $ n $ lines containing the coordinates of these vertices (two integer numbers $ x_{i},y_{i} $ ) in clockwise or counter-clockwise order. It's guaranteed, that the fence does not contain self-intersections. The following four lines contain coordinates of point $ A(x_{a},y_{a}) $ , speeds $ V(x_{v},y_{v},z_{v}) $ , $ F_{down} $ and speed $ U(x_{u},y_{u},z_{u}) $ . All the input numbers are integer. All the coordinates don't exceed $ 10^{4} $ in absolute value. It's guaranteed, that $ z_{v}>0 $ and $ F_{down},z_{u}<0 $ , and point $ A $ is strictly outside the incubator's territory.
输出格式
In the first line output two numbers $ t_{1},t_{2} $ such, that if DravDe air drops at time $ t_{1} $ (counting from the beginning of the flight), he lands on the incubator's territory (landing on the border is regarder as landing on the territory). If DravDe doesn't open his parachute, the second number should be equal to the duration of DravDe's falling down. If it's impossible for DravDe to get to the incubator's territory, output -1 -1. If the answer is not unique, output the answer with the minimum $ t_{1} $ . If the answers are still multiple, output the answer with the minimum $ t_{2} $ . Your answer must have an absolute or relative error less than $ 10^{-6} $ .
输入输出样例
输入样例 #1
4
0 0
1 0
1 1
0 1
0 -1
1 0 1
-1
0 1 -1
输出样例 #1
1.00000000 0.00000000
输入样例 #2
4
0 0
0 1
1 1
1 0
0 -1
-1 -1 1
-1
0 1 -1
输出样例 #2
-1.00000000 -1.00000000
输入样例 #3
4
0 0
1 0
1 1
0 1
0 -1
1 1 1
-1
1 1 -1
输出样例 #3
0.50000000 0.00000000