Doubt about mo's algorithm

Can anyone explain me, what block size do I have to take, I thought its root(n), bt in this question FCTRE Problem - CodeChef (Factor Tree), when I took the size of block to be root(n), it gives TLE, when i further increase the size to 625 (constant), it still gives tle CodeChef: Practical coding for everyone , bt when i increase it more to 1000, it gives an AC CodeChef: Practical coding for everyone , why does that happen??, what block size do i have to take?