Pagini recente » Cod sursa (job #300213) | Cod sursa (job #2371088) | Cod sursa (job #428505) | Cod sursa (job #582239) | Cod sursa (job #489650)
Cod sursa(job #489650)
#include<cstdio>
int t;
long long m=9973;
void read(),solve(),sol();
int main()
{
read();
solve();
return 0;
}
void read()
{
freopen("ssnd.in","r",stdin);
freopen("ssnd.out","w",stdout);
scanf("%d",&t);
}
void solve()
{
for(;t;t--)sol();
}
void sol()
{
int f,N,n;
long long S,s,d,p,k;
scanf("%lld",&n);
S=1;N=1;
d=2;if(n%d==0){p=1;s=0;f=0;while(n%d==0){f++;s+=p;p*=d;n/=d;}s+=p;s%=m;N*=f+1;S=(S*s)%m;}
d=3;if(n%d==0){p=1;s=0;f=0;while(n%d==0){f++;s+=p;p*=d;n/=d;}s+=p;s%=m;N*=f+1;S=(S*s)%m;}
for(k=1;;k++)
{
d=6*k-1;if(d*d>n)break;
if(n%d==0){p=1;s=0;f=0;while(n%d==0){f++;s+=p;p*=d;n/=d;}s+=p;s%=m;N*=f+1;S=(S*s)%m;}
d=6*k+1;if(d*d>n)break;
if(n%d==0){p=1;s=0;f=0;while(n%d==0){f++;s+=p;p*=d;n/=d;}s+=p;s%=m;N*=f+1;S=(S*s)%m;}
}
if(n>1){d=n;p=1;s=0;f=0;while(n%d==0){f++;s+=p;p*=d;n/=d;}s+=p;s%=m;N*=f+1;S=(S*s)%m;}
printf("%lld %lld\n",N,S);
}