80B.md (2519B)
1 Source: https://codeforces.com/problemset/problem/80/B 2 3 B. Depression 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 Do you remember a kind cartoon "Beauty and the Beast"? No, no, there was no firing from machine guns or radiation mutants time-travels! 22 23 There was a beauty named Belle. Once she had violated the Beast's order and visited the West Wing. After that she was banished from the castle... 24 25 Everybody was upset. The beautiful Belle was upset, so was the Beast, so was Lumiere the candlestick. But the worst thing was that Cogsworth was upset. Cogsworth is not a human, but is the mantel clock, which was often used as an alarm clock. 26 27 Due to Cogsworth's frustration all the inhabitants of the castle were in trouble: now they could not determine when it was time to drink morning tea, and when it was time for an evening stroll. 28 29 Fortunately, deep in the basement are lying digital clock showing the time in the format HH:MM. Now the residents of the castle face a difficult task. They should turn Cogsworth's hour and minute mustache hands in such a way, that Cogsworth began to show the correct time. Moreover they need to find turn angles in degrees for each mustache hands. The initial time showed by Cogsworth is 12:00. 30 31 You can only rotate the hands forward, that is, as is shown in the picture: 32 33  34 35 As since there are many ways too select such angles because of full rotations, choose the smallest angles in the right (non-negative) direction. 36 37 Note that Cogsworth's hour and minute mustache hands move evenly and continuously. Hands are moving independently, so when turning one hand the other hand remains standing still. 38 39 Input 40 41 The only line of input contains current time according to the digital clock, formatted as HH:MM ($00 \le$HH$\le 23$, $00 \le$MM$\le 59$). The mantel clock initially shows 12:00. 42 43 Pretests contain times of the beginning of some morning TV programs of the Channel One Russia. 44 45 Output 46 47 Print two numbers $x$ and $y$ — the angles of turning the hour and minute hands, respectively ($0 \le x,y \lt 360$). The absolute or relative error in the answer should not exceed $10^{-9}$. 48 49 Examples 50 51 Input 52 53 ``` 54 12:00 55 ``` 56 57 Output 58 59 ``` 60 0 0 61 ``` 62 63 Input 64 65 ``` 66 04:30 67 ``` 68 69 Output 70 71 ``` 72 135 180 73 ``` 74 75 Input 76 77 ``` 78 08:17 79 ``` 80 81 Output 82 83 ``` 84 248.5 102 85 ``` 86 87 Note 88 89 A note to the second example: the hour hand will be positioned exactly in the middle, between 4 and 5.