Add solution to POJ 3732.