27 lines
382 B
Python
27 lines
382 B
Python
# Fill Input
|
|
|
|
input = ""
|
|
|
|
try:
|
|
with open("02.txt", 'r', encoding='utf-8') as file:
|
|
input += file.read()
|
|
except Exception as e:
|
|
print(f"An error occurred: {e}")
|
|
|
|
# Result
|
|
|
|
res1, res2 = 0, 0;
|
|
for line in input.split('\n'):
|
|
if line == "":
|
|
break
|
|
|
|
box = [int(n) for n in line.split('x')]
|
|
|
|
box.sort()
|
|
l,w,h= box
|
|
|
|
res1+=3*l*w+2*(w*h+l*h)
|
|
res2+=2*(l+w)+l*w*h
|
|
|
|
print(res1, res2)
|