Cod sursa(job #1891238)

Utilizator shantih1Alex S Hill shantih1 Data 23 februarie 2017 20:38:35
Problema Suma divizorilor Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include <iostream>
#include <fstream>
#include <cmath>

using namespace std;

int rez, b, e, i, x=1;

int main () {
    
    ifstream fin("sumdiv.in");
    ofstream fout("sumdiv.out");
    
    fin >> b >> e;
    
    for (i = 1; i <= e+1; i++)  x *= b;
    
    fout << (x-1) / (b-1);
}