Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

BINCLOCK - Binary clock

John found on the internet a specific type of clock which is called binary clock. He got interested in those clocks but he is not sure if he can change normal hour to binary format, so he asked you to write a program which would check whether he made it correctly or not.

Explanation of binary clock: http://en.wikipedia.org/wiki/Binary_clock

Input

The first line of the standard input contains one integer t (t<101) which is the number of test cases.

In each of the next t tests there are 24 digits (four lines with 6 digits in each of them) which represent the binary clock. There is one blank line after each test.

Output

One line with hour in following format: hour:min:sec or ERROR if time is incorrect.

Example

Input:

3
000000
000000
000000
010101

000000
010101
001011
100110

000001
000001
000001
000001

Output:
01:01:01
14:25:36
ERROR


Added by:Piotr Kąkol
Date:2009-12-21
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: SCM qobi

hide comments
2011-02-27 19:53:00 Hallvard Norheim Bø
Apart from this challenge, where I spent some time probing for holes in the testcases, ISPRIME had a big hole: no Fermat pseudoprimes, so one could use the very simple Fermat pseudoprimality test. But you fixed that some time ago :-)

Last edit: 2011-02-27 19:57:41
2011-02-27 18:41:32 Piotr KÄ…kol
> No problem, part of the challenge is finding holes in the testcases I guess ;-)

Are they so horrible? :-(
Please inform me if You found an easy-test task.

> By the way, is there a way to get email notification when a rejudge happens? It's easy to miss.

No. But it's a good idea! I suggested that on spoj.pl/forum.

Last edit: 2011-02-27 18:42:35
2011-02-27 18:00:12 Hallvard Norheim Bø
No problem, part of the challenge is finding holes in the testcases I guess ;-)

By the way, is there a way to get email notification when a rejudge happens? It's easy to miss.

Last edit: 2011-02-27 18:07:16
2011-02-27 15:59:42 Piotr KÄ…kol
Thanks to zorro (kokosowo) who told me that tests are weak, I added 35 more tests and made rejudge.
That's why some AC got WA.

Please accept my apology for Your inconvenience.
For my excuse I can just say that it was one of my first tasks.

Last edit: 2011-02-27 16:00:12
2011-01-06 17:25:48 Hallvard Norheim Bø
It's OK now. (But my solution does not need a trailing empty line anymore, found a better way :)
2011-01-03 07:27:27 Piotr KÄ…kol
Is it now ok?
It was because SPOJ somehow delete the last endline if it's the last char. I added second endline so that there's still one left at the end.
2011-01-01 23:17:01 Hallvard Norheim Bø
The last testcase lacks an empty line at the end (not the displayed input, but the one actually passed to the program).

Last edit: 2011-01-01 23:18:22
2010-12-01 18:27:36 Piotr KÄ…kol
So why do You keep using IE? On Firefox, Opera and Google Chrome it looks ok.
2010-12-01 15:32:31 hbm
Still looks the same (pesky IE).
2010-11-24 15:47:06 Piotr KÄ…kol
That was my second idea in case the first one doesn't work.
Is it ok now?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.