Logo
(追記) (追記ここまで)

10393번 - Time Warp 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB30161657.143%

문제

Tim Ang is a bit of a nerd. Check that – he’s a HUGE nerd. When you ask him the time, he might say something like “20 after 8”, which seems normal, but other times he’ll say things like “90 after 8” or “126 til 4”, which gives you pause. When you ask him about this, Tim say that “20 after 8” means the first time after 8 that the hour and minute hands of the clock make an angle of 20 degrees; “126 til 4” means the closest time before 4 that the hands make an angle of 126 degrees. As Tim walks away snickering, you resolve that you will write a program that will automatically convert Tim’s times to our more normal, non-nerdy times. That’ll show the little geek!

입력

The input file starts with an integer n indicating the number of test cases. Each test case consists of a single line of the form a after b or a til b, where a and b are integers satisfying 0 ≤ a < 360, and 1 ≤ b ≤ 12. All angles are measured starting at the hour hand and moving clockwise until reaching the minute hand (so, for example, at 9 o’clock the hands make an angle of 90 degrees and at 3 o’clock they make an angle of 270).

출력

For each test case, output the time in the format h:m:s, where h, m and s are the hour, minutes and seconds closest to the given angle and hour and 1 ≤ h ≤ 12. Always use two digits to represent the number of minutes and seconds.

제한

예제 입력 1

4
20 after 8
126 til 4
180 til 1
0 after 12

예제 출력 1

Case 1: 8:47:16
Case 2: 3:39:16
Case 3: 12:32:44
Case 4: 1:05:27

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2014 East Central Regional Contest H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /