Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/begin-qiya-otilgan-jism

Projectile at an angle

Medium 1000 ms 64 MB 39%
Share

A body is thrown from the ground at $v_{0}$ m/s at an angle of $\alpha$ degrees to the horizontal (air resistance is ignored). Find the flight time $T$, the maximum height $H$ and the range $L$:

$$T = \frac{2 * v_{0} * \sin \alpha}{g}, \qquad H = \frac{v_{0}^{2} * \sin^{2} \alpha}{2 * g}, \qquad L = \frac{v_{0}^{2} * \sin (2 * \alpha)}{g}$$

Free-fall acceleration $g = 9.8$. Use $\pi = 3.141592653589793$.

The parabolic path of a body thrown at speed v0 at angle alpha to the horizontal: maximum height H, range L

Input

One line with two positive integers: $v_{0}$ and $\alpha$.

Output

One line with three numbers: $T$, $H$ and $L$, each with exactly 2 digits after the decimal point (for example, 1.44).

Note

$1 \le v_{0} \le 1000$
$1 \le \alpha \le 89$

Examples

Input #1
10 45
Output #1
1.44 2.55 10.20
Input #2
20 30
Output #2
2.04 5.10 35.35

Sign in to submit a solution

Signing up is free and takes a minute.