Angle

[image]

At the end of each stage of the video game, the ship controlled by the
player will face an enemy boss which occupies a large part of the
screen. The ship can shoot along any integer angle (in degrees) away
from the vertical axis, as shown in the figure. Compute the maximum
integer angle such that the ship will hit the boss if it fires in that
direction.

Input

The input consists of several test cases. Each test case consists of an
integer height 1 ≤ H ≤ 1000, corresponding to the vertical distance from
the ship to the boss, and an integer width 1 ≤ W ≤ 1000, corresponding
to the horizontal extension of the boss from the vertical axis.

Output

For each test case, a number on a single line representing the maximum
integer angle such that the ship will hit the boss.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T22:45:28.673Z

© Jutge.org, 2006–2026.
https://jutge.org
