Add solution to problem 489

Use buffered IO to avoid TLE
Add solution to problem 11498