Example output
Puzzle: The Puzzle of the Stranded Astronauts
On a distant planet, three astronauts have been stranded. They have managed to salvage a single spacecraft capable of making the journey back to Earth, but the spacecraft is not in its best condition. The spacecraft's energy system can only handle one astronaut at a time, and it requires 10 units of energy to make a complete one-way trip to Earth.
Here's the dilemma: each astronaut has a unique energy pack with a finite amount of energy. Astronaut A has a pack with 15 units of energy, Astronaut B has a pack with 25 units of energy, and Astronaut C has a pack with 35 units of energy. Each astronaut's energy pack can be used to fuel the spacecraft, but they can only transfer all of their energy at once and can't split it up.
To make matters more complicated, the spaceship’s energy system can only hold 10 units of energy at a time, and any extra energy input at one time will be lost.
How can the astronauts get back to Earth without leaving anyone stranded, and without wasting any energy units?
Hint: Consider the possibility that the spaceship may need to make more trips than there are astronauts. Astronauts can share energy packs, but remember, they can only transfer all their energy at once and can't split it up.
Solution:
Astronaut A uses his 15 energy units to make a trip to Earth and leaves the remaining 5 units in the spaceship for the return journey.
Astronaut B uses his 25 energy units to fuel the spaceship, but only 5 units are used to return to the planet, leaving 20 units in the pack.
Astronaut A takes B's pack, goes back to Earth using 10 units, and leaves the remaining 10 units in the spaceship for the return journey.
Astronaut C uses his 35 energy units to fuel the spaceship, but only 10 units are used to return to the planet, leaving 25 units in the pack.
Astronaut A takes C's pack, goes back to Earth using 10 units, and leaves the remaining 15 units in the spaceship for the return journey.
Finally, Astronaut C uses the 15 units left in the spaceship to return to Earth.
Therefore, all astronauts get back to Earth with no energy wasted!