Here n=(x*a)/b. so according to the constraints n lies in [1,1e18]. Just ignore the cases where n>1e9 as n cannot be greater than the sum of its divisors. And you won’t get TLE.
hey brother consider the case where i*i=n, so i and n/i are actually going to be the same and hence you have added that root(n) 2 time to the sum, so just check on that condition.