Pagini recente » Cod sursa (job #3164054) | Cod sursa (job #2260142) | Cod sursa (job #2749252) | Cod sursa (job #3230912) | Cod sursa (job #2122800)
#include <iostream>
#include <cmath>
#include <vector>
#include <fstream>
#include <unordered_map>
//#include <ctime>
#define ll long long
using namespace std;
ifstream fcin("ssnd.in");
ofstream fcout("ssnd.out");
const ll NLIM = 1e12 + 10;
const int MOD = 9973;
int T;
ll N;
int a;
int nprim[1000000 + 10];
int primesSize = 0;
int primes[1000000];
void calcSiev()
{
nprim[1] = 1;
for( int i = 2; i <= 1000; ++i )
{
if( !nprim[i] )
{
for( int j = i * i; j < 1000000; j += i )
nprim[j] = 1;
}
}
for( int i = 1; i <= 1000000; ++i )
if( !nprim[i] )
primes[primesSize++] = i;
}
int main()
{
//clock_t start = clock();
calcSiev();
ios::sync_with_stdio( false );
fcin >> T;
while( T-- )
{
fcin >> N;
int nr = 1;
ll sum = 1;
int i;
for( i = 0; i < primesSize && 1LL * primes[i] * primes[i] <= N; ++i )
{
a = 0;
ll pored = 1;
ll hsum = 1;
while( N % primes[i] == 0 )
{
++a;
N /= primes[i];
pored *= primes[i];
hsum += pored;
}
hsum %= MOD;
nr *= a + 1;
sum *= hsum;
sum %= MOD;
}
if( nr == 1 )
{
nr = 2;
sum = N + 1;
}
else if( N > 1 )
{
nr *= 2;
sum *= N + 1;
sum %= MOD;
}
fcout << nr << " " << sum << "\n";
}
//cerr << ( clock() - start ) / ( double ) CLOCKS_PER_SEC;
}