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

~/algor $ cat problems/strelkalar-orasidagi-burchak

Angle between the hands

Medium 1000 ms 64 MB 41%
Share

A clock shows $h$ hours $m$ minutes ($24$-hour time). The dial has $12$ hours: the minute hand turns $6$ degrees per minute, the hour hand $0.5$ degrees per minute. Find the smaller angle between the hour hand and the minute hand (in degrees, from $0$ to $180$).

A clock dial: the hour and minute hands and the smaller angle between them

Input

One line with two integers: $h$ and $m$.

Output

One number — the angle, with exactly 1 digit after the decimal point (for example, 75.0).

Note

$0 \le h \le 23$
$0 \le m \le 59$

Examples

Input #1
3 30
Output #1
75.0
Input #2
21 0
Output #2
90.0

Sign in to submit a solution

Signing up is free and takes a minute.