Code for problem 51B.
Code for problem 41C.
Code for problem 50D.