Solve SRM 158DIV1 500 points