Editorial says Let's fix one x and try to solve this task for it.
okay makes our time complexity q*(something), moving on...
How to find number of i that ai mod x ≤ m for some m
We can use binary search of some sort, making our complexity
q*log(x)*checkerForM, how in the world is this complexity not TLE
Can anyone explain it to me.