This problem is based on the classic puzzle of how you can measure out a specific amount of water using buckets of different sizes and a hose. Initially, all of the buckets are empty, and at each point, the only legal moves are: flling up a bucket,
OR
OR