solve poj 3050