19 lines
414 B
Python
19 lines
414 B
Python
sizes = [7, 7, 7, 6, 7, 5]
|
|
|
|
t = 0
|
|
for line in open("input"):
|
|
if 'x' in line:
|
|
line = line.strip()
|
|
s = line.replace("x"," ").replace(":","").split()
|
|
n = map(int, s)
|
|
w, h, *n = n
|
|
need = sum(sizes[i]*x for i,x in enumerate(n))
|
|
if need > w*h:
|
|
print(line, "impossible")
|
|
else:
|
|
print(line, "<>", w*h - need)
|
|
t += 1
|
|
|
|
print(t)
|
|
|