Cod sursa(job #1988588)
Utilizator | Data | 3 iunie 2017 15:32:58 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <fstream>
#define ll long long
using namespace std;
ifstream fin("ssnd.in");
ofstream fout("ssnd.out");
int main()
{
int t,i,cnt,j;
ll n,S;
fin >> t;
for(i=1; i<=t; i++)
{
fin >> n,cnt=0,S=0;
for(j=1; j*j<n; j++)
if(n%j==0) cnt+=2,S+=(j+n/j)%9973;
if(j*j==n)
if(n%j==0) cnt++,S+=j%9973;
fout << cnt << " " << S%9973 << "\n";
}
return 0;
}