You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
185 B

with open("input2_pre.txt") as f:
s = 0
for line in f.readlines():
a, b = [int(a) for a in line.strip().split()]
s += b + ((3, 0, 6)[((a - b) % 3)])
print(s)