# | Problem | Pass Rate (passed user / total user) |
---|---|---|
13271 | Linear Function |
|
13990 | ClockHands |
|
Description
In this problem, given a linear function in the form of
,
where a, b and c are non-zero integers. You are asked to calculate f(x), or calculate the x by giving the f(x) as input.
Input
In the first line, there are three non-zero integers : a, b and c.
Next, there're two integers: d and e. If d=0, print the answer of f(x) where x=e; otherwise, calculate the x value where f(x)=e.
All inputs are ranged in [0, 1000].
Output
Print one line which contains a floating point rounded to third decimal places.
Please print '\n' in the last line.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
After being woken up by Noah's alarm clock, Hank, in his anger, looked at his wristwatch.
He was very curious about the angle formed by the hour hand and the minute hand, but he didn't have a protractor at hand to measure it.
So, he decided to borrow a protractor from Noah.
However, since Noah was still sleeping, Hank has no choice but to seek your help in solving this problem. Hank will tell you the current time displayed on his watch in 24-hour format.
Please help him determine the angle between the hour hand (時針) and the minute hand (分針) on the clock (there are two possible angles; provide the smaller one as the answer).
Input
The input consists of a single line in the format h:m, where h and m are guaranteed to be 2-digit integers.
This represents the time displayed on Hank's watch, with h indicating the hour and m indicating the minute.
Constraints:
- 0 <= h <= 23, 0 <= m <= 59
Output
Please output the smallest angle between the hour and minute hands, rounded to three decimal places.
The answer should be in the range of 0 to 180.
Please remember to print "\n" at the end.