I wanted to solve this problem and getting TLE.

Here is my code,

```
#include <iostream>
#include <cassert>
#include <vector>
#include <numeric>
using namespace std;
int main(){
int test_case;
vector<int> divisors;
scanf("%d", &test_case);
assert(test_case <= 200000);
while(test_case--) {
int number;
scanf("%d", &number);
assert(number >= 1);
assert(number <= 500000);
int half_number = number / 2;
for(int i = 1; i <= half_number; i++) {
if(number%i == 0 && i != number) {
divisors.push_back(i);
}
}
printf("%d\n", accumulate(divisors.begin(), divisors.end(), 0));
divisors.clear();
}
return 0;
}
```