WA on test #8.
Code for problem 30D.
Code for problem 32C.