Solving problems from srm 635