406201: GYM102309 C Cai Xukun and Orz Pandas

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Cai Xukun and Orz Pandastime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Cai Xukun is a famous basketball star. He is known as the NBA Brand Ambassador in the 2019 Spring Festival. One day Cai Xukun wants to show his his basketball skill to the Orz Pandas. He would throw basketball from the point $$$\mathbf{P} = (x_0, y_0)$$$ to the hoop at the point $$$\mathbf{Q} = (x_1, y_1)$$$. The basketball's trajectory is a part of a ellipse (according to Kepler's First Law) but we can make a good approximation with a parabola:

$$$$$$\mathbf{B}(t) = \mathbf{P} + \mathbf{v}_0 t + \frac{1}{2} \mathbf{g} t^2$$$$$$

$$$\mathbf{v}_0 = (v_x, v_y)$$$ is the initial velocity. If at some time $$$t$$$, $$$\mathbf{B}(t) = \mathbf{Q}$$$, then Cai Xukun can throw the basketball into the hoop. Cai Xukun can only throw the basketball with an initial velocity not too large: $$$|\mathbf{v}_0| \leq v_{max}$$$.

Now the Orz Pandas will give you $$$\mathbf{P}$$$, $$$\mathbf{Q}$$$, and $$$v_{max}$$$. It's well-known that $$$\mathbf{g} = (0, -9.80665 m \cdot s^{-2})$$$. You should find an initial velocity vector $$$\mathbf{v}_0$$$ so that Cai Xukun can throw the basketball into the hoop, and the time $$$t$$$ when the basketball flies into the hoop.

Since Cai Xukun plays basketball so well, it's guaranteed that a solution exists.

Input

There are multiple test cases. Please process until EOF.

Each test case contains $$$5$$$ integers $$$x_0$$$, $$$y_0$$$, $$$x_1$$$, $$$y_1$$$, and $$$v_{max}$$$. The unit of the $$$4$$$ coordinates is $$$m$$$, and the unit of $$$v_{max}$$$ is $$$m/s$$$.

It's guaranteed that the absolute value of each integer does not exceed $$$200$$$, and $$$v_{max} >= 0$$$.

Output

For each test cases, output $$$3$$$ decimals $$$v_x$$$, $$$v_y$$$, and $$$t$$$. To avoid floating-point errors, your answer is considered correct if $$$v_{max}^2 - v_x^2 - v_y^2 > -10^{-6}$$$, and $$$|\mathbf{B}(t) - \mathbf{Q}| \leq 10^{-6}$$$.

ExampleInput
0 0 10 0 15
Output
6.3415532 7.7320568 1.5769008

加入题单

上一题 下一题 算法标签: