Cod sursa(job #1311754)
Utilizator | Data | 8 ianuarie 2015 16:05:06 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.58 kb |
#include<fstream>
using namespace std;
long long a,x,y,t,c,s;
int main()
{
ifstream fin("ssnd.in");
ofstream fout("ssnd.out");
fin>>t;
x=1;
while(x<=t)
{
fin>>a;
s=0;
c=0;
y=1;
while(y*y<a)
{
if(a%y==0)
{
s=s+y+a/y;
s=s%9973;
c=c+2;
}
y=y+1;
}
if(y*y==a)
{
c++;
s=s+y;
}
fout<<c<<" "<<s<<"\n";
x=x+1;
}
return 0;
}