The classic puzzle goes something like this: "You are standing in front of a lake with a 3 gallon bucket and a 5 gallon bucket, how can you get 4 gallons of water?"
Is there an easy way to generate the triple (A,B,C) where you can get C gallons of water using buckets of size A and B?