Add solution code

POJ 1251