Cod sursa(job #38502)

Utilizator RobytzzaIonescu Robert Marius Robytzza Data 25 martie 2007 20:50:37
Problema Next Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include<fstream.h>
int main(){
ifstream fin("next.in");
ofstream fout("next.out");
long long N,P;
fin>>N>>P;
if (N%P==0&&N>=P)
    fout<<N;
else
  if (P>N)
     fout<<P;
  else
     fout<<(N/P+1)*P;
fin.close();
fout.close();
return 0;
}