[SRM] Solve Problem SRM 612 II M.