problem 31 to 40 solved