Cod sursa(job #672438)

Utilizator raduiris94Alexa Radu raduiris94 Data 2 februarie 2012 10:22:51
Problema Suma si numarul divizorilor Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 kb
#include<cstdio>
#define DN 10005
#define MOD 9973
int n, t, c[2][DN];
void ciur()
{
	for(int i=2; i<DN; ++i) 
	{
		for(int j=i; j<DN; j+=i)
		{
			c[0][j]++;
			c[1][j]=(c[1][j]+i)%MOD;
		}
	}
}
int main()
{
	freopen("ssnd.in", "r", stdin);
	freopen("ssnd.out", "w", stdout);
	scanf("%d", &t);
	ciur();
	for(int i=1; i<=t; ++i)
	{
		scanf("%d", &n);
		printf("%d %d\n", ++c[0][n], (++c[1][n])%MOD);
	}
}