aoc2015/d02/part1.py

18 lines
299 B
Python
Raw Permalink Normal View History

2023-12-01 09:42:13 +00:00
import sys
def processline(l):
# a x b x c
(a,b,c) = tuple(map(int,l.split('x')))
print(l, a,b,c)
s1 = a * b
s2 = a * c
s3 = b * c
slack = min(s1,s2,s3)
return 2*(s1+s2+s3)+slack
R = 0
for l in sys.stdin.readlines():
n = processline(l[:-1])
R += n
print(R)