@ Rajesh , really nice question rajesh..sounds simple but tough one to solve...

Even I agree (learn't the harder way though

)

ofcourse 20 mod 3 is 2 but not all the multiple of 3 plus 2 is multiple of 20...

If you subtract 20 from a number which is a multiple of 3 + 2, then the number becomes a multiple of 3 (of course only for numbers greater than 22).

finally u said (multiple of 3) +1 can not be purchased...but 46, 49,..100 all number of burger can ber purchases...

I agree I was wrong here. If one subtracts 20 from a number which is a multiple of 3 + 1, then it will be another number which is a multiple of 3 + 2, and these many burgers can be bought as explained above.

So the solution is in figuring out the maximum number which

1. can be subtracted by 20 and not 40. i.e. the answer lies between 20 & 40+6.

2. is a multiple of 3 + 1.

So I feel the answer is 43.Thanks Deepak for putting me on the right track