66 lines
1.1 KiB
C++
66 lines
1.1 KiB
C++
|
#include <iostream>
|
|||
|
#include <cstdio>
|
|||
|
#include <algorithm>
|
|||
|
#include <cmath>
|
|||
|
using namespace std;
|
|||
|
const int N=1e7+5,M=7e5+5;
|
|||
|
int pr[M];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
bool b[N];//<2F>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
int cnt=0;
|
|||
|
inline void prime()
|
|||
|
{
|
|||
|
for(int i=2;i<N;i++)
|
|||
|
{
|
|||
|
if(!b[i])
|
|||
|
{
|
|||
|
pr[++cnt]=i;
|
|||
|
}
|
|||
|
for(int j=1;j<=cnt&&pr[j]*i<N;j++)
|
|||
|
{
|
|||
|
b[pr[j]*i]=1;
|
|||
|
if(i%pr[j]==0)
|
|||
|
{
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
int main()
|
|||
|
{
|
|||
|
int t;
|
|||
|
int t1 = 0;
|
|||
|
long long n;
|
|||
|
int len;
|
|||
|
int now;
|
|||
|
int ans;
|
|||
|
prime();
|
|||
|
scanf("%d", &t);
|
|||
|
while (t--)
|
|||
|
{
|
|||
|
ans = 1;
|
|||
|
scanf("%lld", &n);
|
|||
|
len = sqrt(n);
|
|||
|
for (int i = 1; pr[i] <= len&&pr[i]; i++)//re
|
|||
|
{
|
|||
|
|
|||
|
if (n % pr[i] == 0)
|
|||
|
{
|
|||
|
now = 0;
|
|||
|
while (n % pr[i] == 0)
|
|||
|
{
|
|||
|
n /= pr[i];
|
|||
|
now++;
|
|||
|
}
|
|||
|
ans *= (2*now+1);
|
|||
|
}
|
|||
|
}
|
|||
|
if (n > 1)
|
|||
|
{
|
|||
|
ans *= 3;
|
|||
|
}
|
|||
|
ans=ans/2+1;
|
|||
|
printf("Case %d: %d\n", ++t1, ans);
|
|||
|
}
|
|||
|
return 0;
|
|||
|
}
|