codyssi_2025/03_supplies_in_surplus
2025-03-29 02:13:40 +01:00
..
__pycache__ feat: primo commit, completati primi due esercizi 2025-03-29 02:13:40 +01:00
data.py feat: primo commit, completati primi due esercizi 2025-03-29 02:13:40 +01:00
part1.py feat: primo commit, completati primi due esercizi 2025-03-29 02:13:40 +01:00
README.md feat: primo commit, completati primi due esercizi 2025-03-29 02:13:40 +01:00

Codyssi - Supplies in Surplus!

Part 1 Difficulty Rating: 1

After a refreshing night of sleep, youve arrived at the seaside!

There: a wooden Greek warship, complete with masts and sails. That must be the vessel youll use for your journey. Oddly, there seem to be very few technological devices on the ship…

“Ah, you must be the team from the lab! Im the captain of the vessel ODC-US. My crew will be at your service for your journey to Atlantis. Well be setting sail soon, but weve received a surplus of supplies from the lab—theres no way we could load all this onto the ship.”

Sure enough, there are clearly too many piles of boxes to load onto the ship. Youll probably only have enough space for essentials, especially since the captains crew is also on the ship.

One of the crewmates hands you an inventory list, and he explains the situation to you.

Each box has one number label. Boxes with the same number label contain the same items.

Each line in the list contains two ranges of numbers.

Each range of numbers represents the numbers on the boxes in each pile. For example, 3-5 represents a pile with 3 boxes, labelled 3, 4, and 5 respectively.

First, youll have to figure out the total number of boxes in all of the piles combined.

For example, consider the (smaller) inventory list below:

8-9 9-10 7-8 8-10 9-10 5-10 3-10 9-10 4-8 7-9 9-10 2-7

The first range, 8-9, contains 2 boxes. The second range, 9-10, contains 2 boxes. The third range, 7-8, contains 2 boxes. The fourth range, 8-10, contains 3 boxes. By continuing this process, we can determine that the total number of boxes (for this file) is 43.

Considering your file, what is the total number of boxes in all of the piles?