No.1236 Long Hand and Short Hand
タグ : / 解いたユーザー数 260
作問者 : 👑
PCT
PCTprobability
Problem Statement
There is an ordinary analog clock. The current time is $A$ hours $B$ minutes $0$ seconds. Find the minimum number of seconds from now until the minute hand and the hour hand of this clock are at the same position. Round down any fractional part.
Input
$A\ B$
- All inputs are integers.
- $0 \le A < 24$
- $0 \le B < 60$
- The input is given with leading zeros so that both of $A,B$ have $2$ digits.
Output
Output the minimum number of seconds until the minute hand and the hour hand overlap, rounding down any fractional part. Also, print a newline at the end.
Sample
Sample 1
Input
11 59
Output
60
The hands overlap exactly 1 minute later. Since 1 minute is 60 seconds, output 60.
Sample 2
Input
12 34
Output
1887
Round down any fractional part.
Sample 3
Input
12 00
Output
0
The hands overlap exactly right now.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。