Advent-of-Code/2015/day 2/P1/paper.py

10 lines
269 B
Python
Raw Permalink Normal View History

2019-12-01 17:44:00 +01:00
boxs = open("input.txt").read().split("\n")[:-1]
paper = 0
for i in list(boxs):
i = i.split("x")
dim1 = (int(i[0])*int(i[1]))
dim2 = (int(i[1])*int(i[2]))
dim3 = (int(i[2])*int(i[0]))
paper+=2*dim1+2*dim2+2*dim3+min([dim1, dim2, dim3])
print(paper)