Cod sursa(job #785161)
Utilizator | Data | 7 septembrie 2012 23:13:26 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
using namespace std;
int N, D;
int main()
{
ifstream in("next.in");
ofstream out("next.out");
in >> N >> D;
int p = N / D;
int max;
if(N % D == 0)
max = N;
else
max = ((p + 1)* D);
out << max << endl;
return 0;
}