Cod sursa(job #2385209)

Utilizator Radu684Radu Georgescu Radu684 Data 21 martie 2019 18:35:40
Problema Next Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.3 kb
#include <fstream>

using namespace std;

//te strang de buci
ifstream in ("next.in");
ofstream out ("next.out");

int main()
{
    //int n, d;
    float r, rest, n, d;
    in >> n >> d;
    r = n/d;
    r = r - int(n/d);
    rest = 1/r;
    out << int(n + (d - rest + 1));
    return 0;
}