poj_3187 ac code