summaryrefslogtreecommitdiff
path: root/2010/1c/c/c.py
blob: 720b60d4399ed4b6b3dfa6c2f25897bd419d09d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
f = open('1.in', 'r')
o = open('1.out', 'w')

T = int(f.readline().strip())

for t in xrange(T):
    (M, N) = map(int, f.readline().strip().split(' '))
    grid = [bin(int(f.readline().strip(), 16))[2:] for _m in range(M)]
    
    nextSquare = min(M, N)
    
    
    res = '\n'.join([x for x in grid])
    s = "Case #%d: %s\n" % (t+1, res)
    print s
    #o.write(s)