Tic-Toc

0

0 votes
Very-Easy
Problem

Find minimum angle between hour and minute hand.

Input: The first line contains the number of test cases, T. T lines follow, each of which contains two integer Hour hand H and minute hand M.

Output: Print the minimum angle between the hands.

Constraints

1<=T<=100

00<=H<=12

01<=M<=59

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

In first input time is 12:30 i.e. hour hand is in middle of 12 and 1 & minute hand is pointing at 6 which makes angle of 165 degrees.

In Second input time is 06:00 i.e. hour hand is at 12 and minute hand is at 6 which makes angle of 180 degrees.

Editor Image

?