poj 1658. boring. always careful about edge cases