rename n.py -> 0n.py
This commit is contained in:
26
2015/02.py
Normal file
26
2015/02.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user