38 lines
1.7 KiB
Markdown
38 lines
1.7 KiB
Markdown
Codyssi - Supplies in Surplus!
|
||
|
||
Part 1
|
||
Difficulty Rating: 1
|
||
|
||
After a refreshing night of sleep, you’ve arrived at the seaside!
|
||
|
||
There: a wooden Greek warship, complete with masts and sails. That must be the vessel you’ll 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! I’m the captain of the vessel ODC-US. My crew will be at your service for your journey to Atlantis. We’ll be setting sail soon, but we’ve received a surplus of supplies from the lab—there’s 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. You’ll probably only have enough space for essentials, especially since the captain’s 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, you’ll 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?
|