Ramu has a tiger, hay and a cow. He needs to cross the river. There is a small boat to cross the river, but the boat can only carry only 2 people at a time. i.e., it can either take Ramu + hay or Ramu + cow or Ramu + tiger. If Ramu is not present, cow will eat the hay. Also if Ramu is not there tiger will eat the cow. Help Ramu to cross the river with all 3.
Hint: Ramu need not come back alone.
First take Cow to other side as tiger will not eat hay. Now Ramu comes back and take hay with him to other side. On the return journey take cow alone with him. Then take tiger to other side leaving cow at starting point. Unload tiger and come back to get the cow.
|Start Side||In Transport||Destination|
|Tiger, Cow, Hay,|
|Tiger, Hay||Ramu takes Cow to other side||–|
|Tiger, Hay||–||Cow, Ramu|
|Tiger, Hay||Ramu returns back||Cow|
|Tiger||Ramu takes Hay to other side||Cow|
|Tiger||–||Cow, Hay, Ramu|
|Tiger||Ramu returns with cow||Hay|
|Tiger, Cow, Ramu||–||Hay|
|Cow||Ramu takes Tiger to other side||Hay|
|Cow||–||Hay, Tiger, Ramu|
|Cow||Ramu returns||Hay, Tiger|
|–||Ramu takes Cow to other side||Hay, Tiger|
|–||–||Hay, Tiger, Cow,|