Competitive Problem Solving and the Optimal Prize Schemes