The face of analog clock has two hands and is proportionally divided by
12 marks. The shorter
hour hand makes
the whole turn (
360 degrees) in
12 hours, while the longer
minute hand makes the whole circle each hour.
See Clock Face on wiki for more details.
Suppose, the Cartesian Coordinate System (i.e. ordinary
rectangular coordinate grid) is placed upon the clock face so that the center of the face has coordinates
10, 10 and
Y axis is directed upwards while
X axis is directed to the right (i.e. at
3:00 minute hand is parallel to
axis and hour hand is parallel to
Assuming the length of the minute hand be
9 and the length of the hour hand be
6 you are to find coordinates of
the hand ends for each given time - e.g.
(16 10) and
(10 19) for the time
Input data contain the number of test cases.
Following line contains the testcases themselves in form
Answer should contain four real numbers for each test case -
Y coordinates for
hour hand, then
Y coordinate for minute hand. All values should be simply separated with spaces.
Real values should have accuracy of
1e-7 or better. Time is specified as a value from
input data: 3 12:00 15:00 9:30 answer: 10.0 16.0 10.0 19.0 16.0 10.0 10.0 19.0 4.20444504 11.55291427 10.0 1.0