Cod sursa(job #2629993)
Utilizator | Data | 23 iunie 2020 17:06:38 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
using namespace std;
ifstream in("fractii.in");
ofstream out("fractii.out");
int main()
{
int N, P, P_copy, total, n;
in >> N;
n = 0;
total = ((N-1)*N)/2;
for ( P = 2; P <= N/2; ++P ) {
for ( P_copy = 2; P_copy <= N; P_copy += P_copy )
++n;
++P;
P_copy = P;
}
total = (total - n)*2+1;
out << total;
return 0;
}