Add POJ3842 code

POJ3842 accepted