Why am I getting TLE?

Time Complexity of code - O(t*NLogN)

Link to Code :

@ak7170047 your code is fine
submit over here https://hack.codingblocks.com/app/practice/1/157/problem
there’s some issue at backend.