Hi, Codeforces! I have 13 successful hacks of problem D on last round, and also my solution are TLed(probably on one of my tests :)), and i am going to show you, how does it work.
So we have two part of solution.
Solution and complexity
Now we will try to adjust numbers $$$c, d, x$$$ to hack $$$O(t\sqrt{x} \log x + N \log \log N)$$$ solution. So because we are "factorizing" numbers like $$$\frac{\frac{x}{d_x} + d}{c}$$$