TLE in all test cases

I am getting TLE in all the test cases in the problem Array Queries 1. Please check my code : https://ide.codingblocks.com/s/267622

Try using lazy propagation