Pagini recente » Cod sursa (job #2693844) | Cod sursa (job #2102738) | Cod sursa (job #505914) | Cod sursa (job #153583) | Cod sursa (job #2017273)
#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6 + 15;
const long long MOD = 9973;
bool ciur [MAX + 100];
vector <long long> elemciur;
vector <pair<long long , int>> fact;
void CIUR (){
ciur[1] = 1;
for (long long i=2; i<= MAX; i++){
if (ciur[i] == 0){
elemciur.push_back(i);
for (long long j=i + i; j<=MAX; j += i){
ciur[j] = 1;
}
}
}
}
long long put (long long x, long long p){
long long sol = 1;
while(p){
if (p % 2 == 1){
sol *= x;
}
x *= x;
p /= 2;
}
return sol;
}
int main() {
freopen ("ssnd.in" , "r" , stdin);
freopen ("ssnd.out" , "w" , stdout);
ios::sync_with_stdio(false);
CIUR();
long long t;
cin>>t;
while(t--){
fact.clear();
long long n;
cin>>n;
long long cont = -1;
for (auto x : elemciur){
//cout<<x<<" ";
if (x * x > n){
break;
}
if (n % x == 0){
//cout<<"gasesc "<<x<<'\n';
fact.push_back(make_pair(x , 0));
cont++;
}
while ( n % x == 0){
//cout<<"adaug "<<x<<'\n';
fact[cont].second++;
n /= x;
}
}
if (n != 1){
//cout<<n<<'\n';
fact.push_back(make_pair(n , 1));
}
long long nrdiv = 1;
long long sumadiv = 1;
for (auto x : fact){
//cout<<x.first<<" "<<x.second<<'\n';
sumadiv *= ((put(x.first , x.second + 1) - 1)) / ((x.first - 1));
//cout<<sumadiv<<" ";
sumadiv %= MOD;
nrdiv *= x.second + 1;
}
cout<<nrdiv<<" "<<sumadiv<<'\n';
}
return 0;
}