aoc2015/d02/part2.py

17 lines
277 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)
A = sorted([a,b,c])
s1 = A[0]
s2 = A[1]
return 2*(s1+s2)+a*b*c
R = 0
for l in sys.stdin.readlines():
n = processline(l[:-1])
R += n
print(R)