Your algorithm is too slow. For the following input:
200000
500000
500000
500000
...
500000
500000
This will take an incredible amount of time to run. You need to think about a different way to calculate the sum of the divisors of a number. Maybe you can do many at a time.