problem 49
problem 31