Cod sursa(job #2745389)
Utilizator | Data | 26 aprilie 2021 14:44:04 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("fractii.in");
ofstream out("fractii.out");
int main(){
int n,rez=0;
in>>n;
for(int i=n;i>0;i--){
for(int j=2;j<i;j++){
if(!(i%j==0))rez+=2;
}
}
rez+=n*2-1;
out<<rez;
}