Pagini recente » Cod sursa (job #2436562) | Cod sursa (job #1590916) | Cod sursa (job #1190077) | Cod sursa (job #2376303) | Cod sursa (job #710396)
Cod sursa(job #710396)
#include <fstream>
using namespace std;
fstream fin("ssnd.in",ios::in),fout("ssnd.out",ios::out);
void divizori(long long x,long long &s,long long &nr)
{
long long aux,i;
aux=x/2+1;
s=x;
nr=1;
for (i=1;i<=aux;i++)
{
if (x%i==0)
{
s=s+i;
nr++;
}
}
}
int main()
{
long long t,n,i,s=0,nr=0;
fin>>t;
for (i=1;i<=t;i++)
{
fin>>n;
if (n==1)
{
fout<<1<<" "<<1<<"\n";
}
else
{
divizori(n,s,nr);
fout<<nr<<" "<<s%9973<<"\n";
}
}
fin.close();
fout.close();
return 0;
}