Segment Tree Problem - UEFA Champions League (HELP)

I am trying to solve this segment tree based problem https://www.codechef.com/problems/UCL1
and am getting TLE , i have seen the editorial and my code is pretty much same, can anyone please help me find out the error in my code .

https://www.codechef.com/viewsolution/34349252