Code for problem 40C.
Code for problem 34D.