02_paperwrap.py 281 B

1234567
  1. #!/usr/bin/env python3
  2. import sys
  3. boxes = [tuple(map(int, line.split('x'))) for line in sys.stdin]
  4. print(sum(2 * (l * w + w * h + h * l) + min(l * w, w * h, h * l)
  5. for l, w, h in boxes))
  6. print(sum(2 * min(l + w, w + h, h + l) + l * w * h
  7. for l, w, h in boxes))