Cod sursa(job #798770)
| Utilizator | Data | 17 octombrie 2012 10:18:30 | |
|---|---|---|---|
| Problema | Suma si numarul divizorilor | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.59 kb |
#include<fstream>
#define LL long long
#define M 9973
using namespace std;
LL n;
int t;
int main()
{
ifstream f("ssnd.in");
ofstream g("ssnd.out");
f>>t;
for(int i = 1; i <= t; ++i)
{
f>>n;
LL nr = 2;
LL sum = n + 1;
if(n == 1)sum = nr = 1;
else
{
for(LL j = 2; j <= n / 2; ++j)
if(n % j==0)
{
nr = (nr + 1) % M;
sum = (sum + j) % M;
}
}
g<<nr<<' '<<sum <<'\n';
}
g.close();
return 0;
}
