Legen-wait for it-dary!
^^ dont bring in your homework textbook problems... i remember doing that...
Imagine you have gone to China (from Chandni Chowk, ofcourse) and you have learnt "talwarbaazi" over there. Now you are faced with a dragon and you are supposed to kill it. The dragon has 3 heads and 3 tails. A dragon is considered dead if ALL heads and ALL tails are chopped off. But this dragon is nasty. Here are the conditions:
1) If 1 head is chopped off, 1 extra head grows.
2) If 1 tail is chopped off, 2 extra tails grow.
3) If 2 tails are chopped off together, 1 head grows.
4) If 2 heads are chopped off together, nothing grows.
So what is the minimum number of 'slashes' required to kill the dragon?
this is also preety simple. remember "MINIMUM NUMBER OF SLASHES".