poj problem 2140