Solve 337DIV2 250 points problem.