mirror of
https://github.com/ershisan99/advent-of-code.git
synced 2025-12-16 20:49:24 +00:00
19 lines
362 B
Python
19 lines
362 B
Python
import math
|
|
import os
|
|
|
|
file_path = os.path.join(os.path.dirname(__file__), "./input.txt")
|
|
input = open(file_path).read().strip()
|
|
|
|
count = 0
|
|
|
|
for line in input.splitlines():
|
|
dimensions = sorted(map(int, line.split("x")))
|
|
[x, y, z] = dimensions
|
|
|
|
perimiter = (x + y) * 2
|
|
volume = math.prod(dimensions)
|
|
|
|
count += perimiter + volume
|
|
|
|
print(count)
|