solve poj3665
solve poj3672
solve poj3673