Pagini recente » Cod sursa (job #1437837) | Cod sursa (job #948214) | Istoria paginii runda/miercuri_ora_9.00/clasament | Cod sursa (job #2761398) | Cod sursa (job #2159385)
#include<fstream>
#include<cmath>
#include<iostream>
using namespace std;
ifstream f("ssnd.in");
ofstream g("ssnd.out");
long long n,x;
void calc()
{
if(x==1) {g<<"1 1\n"; return;}
long long s=1,nr=1,d=2;
while(x!=1)
{
if(x%d==0)
{
long long p=0;
while(x)
{
p++;
x/=d;
}
nr*=p+1;
s*=(pow(d,p+1)-1/d-1);
}
}
g<<s<<" "<<nr<<endl;
}
int main()
{
f>>n;
for(int i=1;i<=n;i++)
{
f>>x;
calc();
}
return 0;
}