← RoseCode

ROSECODE 369

Die Hard - 3 Jugs

sinan · Programming ·

See the problem 368 by Philippe. This time we have 3 jugs with capacities 7, 31 and 1048575. What are the gallons that require the most number of moves? Answer format: moves,g1,g2,... where gi-1 < gi Example: 20,54,57,58,62,66,67,70 if we have 3, 7 and 127 gallon jugs [My timing < 1m and my memory requirement < 100M]