The same code got accepted on HackerBlocks
The first test case shows TLE
hello @Enigmatctrance
your solution time complexity is O(T* (b-a) * sqrt(b-a) ) which will surely give tle as per given constraints.
check this video tutorial by prateek bhaiya ->
https://www.youtube.com/watch?v=8sniiDbfPK4