All pastes #750021 Raw Edit

Mine

public text v1 · immutable
#750021 ·published 2007-10-26 04:11 UTC
rendered paste body
bash-3.00$ water 42 70 39 1001
Step 1: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 0/39]      [#3: 0/1001]

Step 2: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 0/1001]

Step 3: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 70/1001]

Step 4: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 70/1001]

Step 5: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 140/1001]

Step 6: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 140/1001]

Step 7: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 210/1001]

Step 8: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 210/1001]

Step 9: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 280/1001]

Step 10: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 280/1001]

Step 11: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 350/1001]

Step 12: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 350/1001]

Step 13: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 420/1001]

Step 14: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 420/1001]

Step 15: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 490/1001]

Step 16: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 490/1001]

Step 17: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 560/1001]

Step 18: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 560/1001]

Step 19: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 630/1001]

Step 20: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 630/1001]

Step 21: Pouring all of water from container #1 into container #3
        State:  [#1: 0/70] [#2: 39/39]     [#3: 700/1001]

Step 22: Filling container #1 from the river.
        State:  [#1: 70/70]        [#2: 39/39]     [#3: 700/1001]

Step 23: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 739/1001]

Step 24: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 739/1001]

Step 25: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 778/1001]

Step 26: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 778/1001]

Step 27: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 817/1001]

Step 28: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 817/1001]

Step 29: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 856/1001]

Step 30: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 856/1001]

Step 31: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 895/1001]

Step 32: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 895/1001]

Step 33: Pouring all of water from container #2 into container #3
        State:  [#1: 70/70]     [#2: 0/39] [#3: 934/1001]

Step 34: Filling container #2 from the river.
        State:  [#1: 70/70]     [#2: 39/39]        [#3: 934/1001]

Step 35: Pouring 67 liters of water from container #1 into container #3
        State:  [#1: 3/70] [#2: 39/39]     [#3: 1001/1001]

Step 36: Pouring all of water from container #2 into container #1
        State:  [#1: 42/70]        [#2: 0/39] [#3: 1001/1001]

Solution reached! Container #1 contains the requested 42 liters of water.