POJ 1742 but TLE