Solve RMQ-ST with Scanner for input. Got TLE with one test sample.