Solve SRM 157DIV1 500 points