https://www.spoj.com/problems/DIVSUM/
#include<stdio.h>
int main()
{
long int t,s;
scanf("%ld",&t);
while(t)
{
scanf("%ld",&s);
long int i,sum=1;
for(i=2;i<=s/2;i++)
{if(s%i==0)
sum=sum+i;
}
printf("%ld\n",sum);
t--;
}
return 0;
}Asked by: Ankan_Ghosh on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.