Pagini recente » Cod sursa (job #447351) | Cod sursa (job #246284) | Cod sursa (job #76185) | Cod sursa (job #1351416) | Cod sursa (job #3161985)
#include <iostream>
#include <fstream>
std::ifstream fin ("ssnd.in");
std::ofstream fout ("ssnd.out");
int main()
{
unsigned short t;
fin >> t;
for (int i=0;i<t;i++)
{
unsigned long long n;
fin >> n;
unsigned short s=0;
bool C[n]{};
for (unsigned long long i=2;i<n;i++)
{
if (C[i]==false) {
for (unsigned long long j=2*i;j<=n;j+=i)
{
C[j]=true;
}
}
}
int c=0;
for (unsigned long long j=1;j*j<=t;t++)
{
if (C[j]==false && t%j==0 ){
c+=1+(j*j!=t);
s=(s+j+(j*j!=t)*t/j)%9973;
}
}
fout << c << " " << s << "\n";
}
return 0;
}