Giving runtime error

Solution: 40919826 | CodeChef can anyone tell me where my code going wrong.

By changing some lines of code i got TLE(Solution: 40920454 | CodeChef) line number 4 and 51 is changed you can check my AC submission Solution: 34682654 | CodeChef(for reference) \

after using array to I am still getting runtime error

Solution: 40921801 | CodeChef your AC code line number 4 and 50 is changed i changed 10e5 to 1e5 and if(ss>=qs&&se<=qe) is changed on line 50

thanks I got it now.