Pagini recente » Cod sursa (job #1992860) | Cod sursa (job #22797) | Cod sursa (job #2486300) | Cod sursa (job #1432805) | Cod sursa (job #2216451)
#include <bits/stdc++.h>
using namespace std;
///vector <pair<int, pair<int,int>> v;
vector <int > ciur;
bitset <1000001> isPrime;
void buildCiur(){
for(int i=2; i <= 1000000; i++){
if(isPrime[i])
continue;
ciur.push_back(i);
for(int j=2*i; j <= 1000000; ++j)
isPrime[i]=1;
}
}
ifstream fin("ssnd.in");
ofstream fout("ssnd.out");
int main()
{
buildCiur();
int t;
long long n;
fin >> t;
for(int i=1; i <= t; ++i){
fin >> n;
long long suma=0;
int divizori=1, x;
for(auto x: ciur){
if(1LL*x*x>n)
break;
long long putere=1;
int exponent=0;
while(n%x==0){
n /= x;
putere *= x;
exponent++;
}
divizori *= (exponent+1);
suma *= (putere*x-1) /( x-1);
}
if(n>1){
divizori *= 2;
suma *= (x+1);
}
fout << divizori << ' ' << suma % 9973 << '\n';
}
return 0;
}