solution for problem 113