Pagini recente » Cod sursa (job #1746951) | Cod sursa (job #2882458) | Cod sursa (job #1487987) | Cod sursa (job #2000571) | Cod sursa (job #2227697)
#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=i + i; j <= 1000000; j+=i)
isPrime[i]=1;
}
}
int main()
{
ifstream fin("ssnd.in");
ofstream fout("ssnd.out");
buildCiur();
int t;
fin >> t;
for(int i=1; i <= t; ++i){
long long n;
long long suma=1;
int divizori=1;
fin >> n;
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 <<= 1;
suma *= (n+1);
}
fout << divizori << ' ' << suma % 9973 << '\n';
}
return 0;
}