Cod sursa(job #1917601)
Utilizator | Data | 9 martie 2017 12:36:50 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.21 kb |
#include <fstream>
#include <cmath>
using namespace std;
ifstream in("sumdiv.in");
ofstream out("sumdiv.out");
int main()
{
int n,p;
in>>n>>p;
out<<(pow(n,p+1)-1)/(n-1);
return 0;
}