Add solution to POJ 3225