VP 54: Paper (30 extra)

What You Need

Any computer with Python 3. You can also use an online Python environment, such as https://colab.research.google.com

Problem Statement

Santa's elves are running low on wrapping paper, and so they need to submit an order for more. They have a list of the dimensions (length l, width w, and height h) of each present, and only want to order exactly as much as they need.

Fortunately, every present is a box (a perfect right rectangular prism), which makes calculating the required wrapping paper for each gift a little easier: find the surface area of the box, which is 2*l*w + 2*w*h + 2*h*l. The elves also need a little extra paper for each present: the area of the smallest side.

For example:

All numbers in the elves' list are in feet. How many total square feet of wrapping paper should they order?

VP 54.1: Area (15 pts)

Use this data:
https://samsclass.info/COMSC122/proj/VP54
How many total square feet of wrapping paper should they order?

That number is the flag.

Part 2: Ribbon

The elves are also running low on ribbon. Ribbon is all the same width, so they only have to worry about the length they need to order, which they would again like to be exact.

The ribbon required to wrap a present is the shortest distance around its sides, or the smallest perimeter of any one face. Each present also requires a bow made out of ribbon as well; the feet of ribbon required for the perfect bow is equal to the cubic feet of volume of the present. Don't ask how they tie the bow, though; they'll never tell.

For example:

How many total feet of ribbon should they order?

VP 54.2: Ribbon (15 pts)

Use the same data:
https://samsclass.info/COMSC122/proj/VP54
How many total feet of ribbon should they order?

That number is the flag.

Source

Adapted from the Advent of Code.

Posted 9-3-25