A good dynamic programming problem(BACKPACK on spoj).