You don’t require segment tree or lazy propagation for such problem . It can be solved using prefix sum. Here is my
 :) : https://ideone.com/aMbZsD
I don’t code in JAVA, so not sure you’ve used the Fastest I/O, but there’s lots of comments there that without the fastest I/O, you will get TLE
I am learning lazy propagation that is the reason for doing it this way.
using wrong algo would take more time and hence maybe its TLE…
People have passed this question through segment tree.
okay then u must me missing something…
r u sure they did it in java ? cuz java is slow