Problems
10018 - Sakib is unique!!!
SUBMIT PROBLEM

Sakib is unique!!!

Time Limit: 1 sec

 

The Problem

Sakib Al Hasan is a brilliant player. Everybody knows him as a great all-rounder. My hero is not so popular, but he is unique. His name is also Sakib. He can determine the time in angular form. If one tells him an angle, he can specify the time in the clock. It hears strange, but is absolutely true. Now it is your turn to make the reverse. First look at the clock and think the way to solve the problem.

Remembers:

  1. A clock looks like a circle.
  2. Angle between two hour hands is 30 degree. (12 hour hands and total circular angle 360 degree).
  3. Each minute hand represents 6 degree.
  4. Also mentionable, with the time of increasing minute, hour hand goes towards to next upper hour hand with angle A(A=30 degree*total minute/60).
  5. Angle can never be negative and can never be more than 180 degree and if it exceeds subtract from 360.

 

The Input

There are several lines of input. Each line contains two integers H and M. H (0<H<=12) represents hour and M (0<=M<60) represents minute. One can take input 3:45 as 3 as hour and 45 as minute individually. Input is terminated by EOF.

 

The Output

For each line of input, output will be an angle rounded to two decimal places formed between hands of hour and minute in a separate line.

 

Sample input

4 30

8 0

 

Sample output

45.00

120.00

 

 

 

[School Level]

Inter School & College Programming Contest (ISCPC) 2015 

Problem Setter: Syed Mohammod Minhaz Hossain