Solve SRM 565DIV2 250points 500points.