Code getting TLE despite the algorithm listed to be working in n*log(n) (GFG link attached)

Problem Link- CodeChef
GFG algo idea I used- Find number of segments covering each point in an given array - GeeksforGeeks
My code- Solution: 68437710 | CodeChef
Please look at it.