Remember we told you that Birbal is a witty trader. So his sole motive is to get rid of the sacks as fast as he can.
For the first sack:
He must be able to fill fruits from one sack to other two sacks. Assume that he is able to do that after M check points. Now to find M,
(Space in first sack) M + (Space in second sack) M = (Remaining fruits in Third Sack) 30 – M
M = 10
Thus after 10 checkpoints, Birbal will be left with only 2 sacks containing 30 fruits each.
Now he must get rid of the second sack.
For that, he must fill the fruits from second sack to the first sack. Assume that he manages to do that after N checkpoints.
(Space in First Sack) N = (Remaining fruits in second sack) 30 – N
N = 15
Thus after he has crossed 25 checkpoints, he will be left be one sack with 30 fruits in it. He has to pass five more checkpoints where he will have to give five fruits and he will be left with twenty five fruits once he has crossed all thirty check points.