Can you fix the link? Otherwise it is hard to check whether the problem is part of an active contest or not.
Links in markdown have the form [text](url)
The url is probably missing. At the bottom of your post you should see a pencil button, clicking that you can edit your question.
You can predict that your algorithm would get TLE:
Your algorithm is \mathcal O(tn) where t is the number of testcases and n is the value of the given integer. Filling in the maximum values of both of these we get that your algorithm would need roughly 500\;000\cdot200\;000=100\;000\;000\;000=10^{11} operations. A handy guideline is that a computer can perform 10^9 operations per second, so your program would take 100s in the worst case, giving TLE.
This means you need a better algorithm to pass the time limit.
To give you a hint: