Refering to following simple problem, which consumed my more than 2Hrs. of time.
http://www.spoj.com/problems/ADAGAME/
and the simple bottom-up solution with comments.
http://ideone.com/7vAGAJ
but something is fishy there !!
Help me find out. Thanks !!