ROSECODE 368
Die Hard
In the movie Die Hard 3, Officer John McLane has to stop a bomb to explode by using a conterweight of 4 gallons.
For this, he can only use 2 jugs of 5 and 3 gallons.
He can do it in 6 moves:
- How many moves ( ) would Officer McLane need to weight 641 gallons with 2 jugs of 19937 and 23209 gallons?
- Which capacity ( ) between 1 and 19936 requieres the largest number of moves ( )?
[Answer format:
[My timing: 4 sec]
For this, he can only use 2 jugs of 5 and 3 gallons.
He can do it in 6 moves:
- [ 5 ] [ 0 ] // Pour 5 gallons in the 1st jug
- [ 2 ] [ 3 ] // Fill the 2nd jug with the 1st
- [ 2 ] [ 0 ] // Empty the 2nd jug
- [ 0 ] [ 2 ] // Pour the 2 gallons from the 1st jug to the 2nd
- [ 5 ] [ 2 ] // Pour 5 gallons the 1st jug
- [ 4 ] [ 3 ] // Fill the 2nd jug with the 1st => We are done: 4 gallons remain in the 1st jug
- How many moves (
- Which capacity (
[Answer format:
[My timing: 4 sec]