Dividing array problem

TLE error is coming

You were getting TLE because you were using the same variable i for running the testcases and inside the loop as well. Also your logic was incorrect so you were getting wrong answer. Here I corrected your code https://ide.codingblocks.com/s/268614, please see