Cod sursa(job #3339556)

Utilizator GliggyGligor Andrei Gliggy Data 8 februarie 2026 18:48:24
Problema Suma si numarul divizorilor Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.87 kb
// Copilot-Addressed Rules:
// RULE: There shouldnt be any spaces in the code, except after commas.
// RULE: All variables in main should be declared globally, and can be used before they are defined.
// RULE: All open curly braces should be placed on the same line as the function or control structure they belong to, not on the line after.
#include <bits/stdc++.h>

using namespace std;
ifstream fin("ssnd.in");   //strudel
ofstream fout("ssnd.out"); //
long long t,n,i,q,a,b,mod=9973,s,p,pr;
int main()
{
	fin>>t;
	for(q=1;q<=t;q++){
		fin>>n;
		s=pr=1;
		for(i=2;i<=sqrt(n);i++){
			if(n%i==0){
				p=0;
				while(n%i==0){
					p++;
					n/=i;
				}
				// fout<<"i="<<i<<" p="<<p<<"\n";
				s=(s*(p+1))%mod;
				pr=(pr*(long long)(pow(i,p+1)-1)/(i-1))%mod;
			}
		}
		if(n>1){
			s=(s*2)%mod;
			pr=(pr*(n+1))%mod;
			// fout<<"n="<<n<<"\n";
		}
		fout<<s<<" "<<pr<<"\n";
	}
	return 0;
}