Cod sursa(job #2275914)

Utilizator ArMyFoRHeLLmihai mihai ArMyFoRHeLL Data 3 noiembrie 2018 19:10:05
Problema Suma si numarul divizorilor Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <fstream>

using namespace std;

ifstream fin ("sand.in");
ofstream fout("sand.out");

const int modulo = 9973;
int main()
{
    int t, n, x, nr, S;
    fin >> t;
    for (int i = 0;i < t;i ++)
    {
        fin >> n;
        nr = S = 0;
        for (int j = 1;j <= n;j ++)
            if ( n % j == 0 )
            {
              nr ++;
              S = 1LL * S + j % modulo;
            }
        S = S % modulo;
        fout << nr << ' ' << S << endl;
    }
    return 0;
}