Cod sursa(job #798769)

Utilizator icb_mnStf Cic icb_mn Data 17 octombrie 2012 10:17:05
Problema Suma si numarul divizorilor Scor 20
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include<fstream>
#define LL long long
#define M 9973

using namespace std;

LL n;
int t;

int main()
{
    ifstream f("ssnd.in");
    ofstream g("ssnd.out");

    f>>t;

    for(int i = 1; i <= t; ++i)
    {
        f>>n;
        LL nr = 0;
        LL sum = 0;
        for(LL j = 1; j <= n; ++j)
            if(n % j==0)
            {
                nr = (nr + 1) % M;
                sum = (sum + j) % M;
            }
        g<<nr<<' '<<sum <<'\n';
    }

    g.close();

    return 0;
}