#BS0000388. Nhảy trượt tuyết (Ski Jumping)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Nhảy trượt tuyết (Ski Jumping)
Ski Jumping
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
A ski-jumping arena is modeled in a coordinate plane. The horizontal origin is at the hilltop and positive coordinates point in the flight direction. The hill is metres high and metres wide, with height given by:
$$h(x)=\begin{cases}H,&x<0,\\ H(1-2(x/L)^2),&0\le x<L/2,\\2H(x/L-1)^2,&L/2\le x<L,\\0,&x\ge L.\end{cases}$$The skier descends through a vertical drop of metres on the approach and leaves horizontally at , metres above the hilltop. Ignore friction and wind. Use gravitational acceleration . Conservation of energy gives the launch speed . During flight the height is
The skier lands at the first intersection of the flight curve with the hill, including the flat ground beyond it. Determine the landing coordinate, the magnitude of the velocity, and the nonnegative smaller angle between the velocity vector and the forward tangent to the hill at the landing point, measured in degrees.

Input
One line contains four integers , all measured in metres.
Output
Print three real numbers on one line: landing coordinate (m), landing speed (m/s), and landing angle (degrees). Each value is accepted with absolute or relative error at most .
Subtasks
- Subtask 1 (20 points): . .
- Subtask 2 (30 points): . .
- Subtask 3 (50 points): .
Examples
Input
50 5 10 100
Output
40.82482905 33.83045965 12.93315449
Explanation
In the first half, solve , giving . Horizontal speed is and vertical velocity is . Their magnitude is 33.83045965; hill slope is . The angle difference is 12.93315449 degrees.
Input
50 5 30 100
Output
81.04978134 40.31656580 26.21334827
Explanation
The second-half equation is , whose valid root is 81.04978134. Velocity components are and , with magnitude 40.31656580. The hill slope yields angle 26.21334827 degrees.
Input
50 5 50 100
Output
104.8808848 45.38832449 46.36470132
Explanation
The flight meets the flat ground at . Speed is . The ground is horizontal, so the angle is in degrees, 46.36470132.