poj 1009 accepted