Mathematics problem in "The Perfect Pieces in the P. Pond"