F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Clock

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)
Total Submission(s): 3459    Accepted Submission(s): 1288


Problem Description
Given a time HH:MM:SS and one parameter $a$, you need to calculate next time satisfying following conditions:

1. The angle formed by the hour hand and the minute hand is $a$.
2. The time may not be a integer(e.g. 12:34:56.78), rounded down(the previous example 12:34:56).

 

Input
The input contains multiple test cases.

Each test case contains two lines.
The first line is the time HH:MM:SS$(0\leq HH<12,0\leq MM<60,0\leq SS<60)$.
The second line contains one integer $a(0\leq a\leq 180)$.
 

Output
For each test case, output a single line contains test case number and the answer HH:MM:SS.
 

Sample Input
0:59:59 30 01:00:00 30
 

Sample Output
Case #1: 01:00:00 Case #2: 01:10:54
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 21:03:59, Gzip enabled