my answer to poj problems