SRM637 div1 medium problem.