spoj.com/problems/KQUERYO
Input is broken for this problem. "return 0" gets AC in 0.00 s. Any other solution gets TLE. The problem should be hidden. I wrote comment to problem's page 3 days ago, but the problem is still there.
Edit: The issue is solved now. Thanks.