Codeforces Beta Round 28(Codeforces 格式)
E
DravDe 拯救世界
DravDe saves the world
Codeforces
2800
原题
← D→

DravDe 拯救世界AI (CI翻译)

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 polygon on 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.

多么可怕!银河鸡帝国试图征服一座美丽的城市“Z”,他们建造了一个巨大的孵化器,每天生产数百万名鸡士兵,并在其周围筑起了围栏。这个巨大的孵化器在平面 $*Oxy*$ 上看起来是一个具有 $*n*$ 个顶点的多边形。自然,DravDe 坐不住了,他想摧毁这个鸡帝国。当然,他会从孵化器开始。AI (CI翻译)

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.

DravDe 位于孵化器领地外部的点 $*A*(*x*_{*a*}, *y*_{*a*})$,并想进入其中杀死在那里工作的所有鸡。但这并不容易!问题在于,DravDe 最近去玩了轮滑,摔断了双腿。他将乘坐喷气式飞机 LEVAP-41 前往孵化器所在的区域。AI (CI翻译)

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

LEVAP-41 以速度 $*V*(*x*_{*v*}, *y*_{*v*}, *z*_{*v*})$ 飞行。DravDe 可以在点 $*A*$ 登上飞机,飞行一段时间后跳伞。DravDe 非常重,因此他会以速度 $*F*_{*down*}$ 垂直下落;但在自由落体的任意时刻,DravDe 都可以打开降落伞,从那一刻起,他会以风速 $*U*(*x*_{*u*}, *y*_{*u*}, *z*_{*u*})$ 下落,直到着陆。不幸的是,DravDe 不擅长数学。你能帮助可怜的世界救世主找到一种空投方案,使他能够降落在孵化器的领地内吗?如果方案不唯一,DravDe 希望找到飞机飞行时间最短的方案。如果仍有多个方案,他希望找到打开降落伞前自由落体时间最短的方案。AI (CI翻译)

Input

输入

AI (CI翻译)

The first line contains the number $*n*$ ($3 ≤ *n* ≤ 10^{4}$) — the 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.

第一行包含围栏的顶点数 $*n*$($3 ≤ *n* ≤ 10^{4}$)。接下来 $*n*$ 行,每行包含一个顶点的坐标(两个整数 $*x*_{*i*}, *y*_{*i*}$),这些顶点按照顺时针或逆时针顺序给出。保证围栏不存在自交。AI (CI翻译)

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.

接下来的四行分别包含点 $*A*(*x*_{*a*}, *y*_{*a*})$ 的坐标、速度 $*V*(*x*_{*v*}, *y*_{*v*}, *z*_{*v*})$、$*F*_{*down*}$ 以及速度 $*U*(*x*_{*u*}, *y*_{*u*}, *z*_{*u*})$。所有输入数值均为整数。所有坐标的绝对值不超过 $10^{4}$。保证 $*z*_{*v*} > 0$ 且 $*F*_{*down*}, *z*_{*u*} < 0$,并且点 $*A*$ 严格位于孵化器领地外部。AI (CI翻译)

Output

输出

AI (CI翻译)

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}$.

第一行输出两个数 $*t*_{1}, *t*_{2}$,使得如果 DravDe 在飞行开始后的时刻 $*t*_{1}$ 空投,他将降落在孵化器的领地内(降落在边界上也视为降落在领地内)。如果 DravDe 不打开降落伞,则第二个数应等于 DravDe 下落的持续时间。如果 DravDe 无法到达孵化器的领地,输出 -1 -1。如果答案不唯一,输出 $*t*_{1}$ 最小的方案。如果仍有多个答案,输出 $*t*_{2}$ 最小的方案。你的答案的绝对误差或相对误差必须小于 $10^{ - 6}$。 AI (CI翻译)

样例

Input #1
4
0 0
1 0
1 1
0 1
0 -1
1 0 1
-1
0 1 -1
Output #1
1.00000000 0.00000000
InputCopy OutputCopy
Input #2
4
0 0
0 1
1 1
1 0
0 -1
-1 -1 1
-1
0 1 -1
Output #2
-1.00000000 -1.00000000
InputCopy OutputCopy
Input #3
4
0 0
1 0
1 1
0 1
0 -1
1 1 1
-1
1 1 -1
Output #3
0.50000000 0.00000000
InputCopy OutputCopy
题目信息
题号
28E
时间限制
1 s
内存限制
256 MB
标签
计算几何
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。