Pagini recente » Cod sursa (job #2357690) | Cod sursa (job #1037441) | Cod sursa (job #2901477) | Cod sursa (job #1826800) | Cod sursa (job #1524936)
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int m = 9973;
long long lgput(int b, int e){
long long sol = 1;
while(e){
if(e&1){
sol = (sol*b)%m;
}
b = (b*b)%m;
e >>= 1;
}
return sol;
}
int main()
{
int t,test,d,c;
long long sum,nr,n;
freopen("ssnd.in", "r", stdin);
freopen("ssnd.out", "w", stdout);
scanf("%d",&t);
for(test = 1;test <= t;test++){
scanf("%lld",&n);
nr = 1;
sum = 1;
if(n%2 == 0){
c = 0;
while(n%2 == 0){
n >>= 1;
c++;
}
nr *= (c+1);
sum = (sum *1LL*(lgput(2,c+1)-1))%m;
}
for(d = 3;1LL*d*d <= n;d += 2){
if(n%d == 0){
c = 0;
while(n%d == 0){
c++;
n /= d;
}
nr *= (c+1);
sum = (sum*1LL*(lgput(d,c+1)-1)/(d-1))%m;
}
}
if(n > 1){
nr *= 2;
sum = (sum*1LL*(n+1))%m;
}
printf("%lld %lld\n",nr,sum);
}
return 0;
}