Solve SRM 563DIV2 250points.