solution to srm-611 division 2 easy problem.