Pagini recente » Cod sursa (job #695477) | Cod sursa (job #1100139) | Cod sursa (job #12053) | Cod sursa (job #1934283) | Cod sursa (job #2500276)
#include <fstream>
#define mod 9973
using namespace std;
bool ciur[1000005];
long long p[78500];
long long x, v, t, e, i, c, j, nr;
long long suma;
ifstream fin ("ssnd.in");
ofstream fout ("ssnd.out");
int main () {
fin>>t;
for (i=2;i<=1000000;i++) {
if (ciur[i]==0) {
p[++c]=i;
for (j=i+i;j<=1000000;j+=i)
ciur[j]=1;
}
}
for (;t--;) {
fin>>x;
e=0;
suma=1;
nr=1;
for (j=1;p[j]*p[j]<=x && x!=1;j++) {
if (x%p[j]==0) {
e=0;
v=1;
while (x%p[j]==0) {
e++;
v*=p[j];
x/=p[j];
}
suma*=((v*p[j]-1)/(p[j]-1));
nr*=(e+1);
}
}
if (x!=1) {
nr*=2;
suma*=((x*x-1)/(x-1));
}
fout<<nr<<" "<<suma%mod<<"\n";
}
return 0;
}