Cod sursa(job #38501)

Utilizator RobytzzaIonescu Robert Marius Robytzza Data 25 martie 2007 20:49:54
Problema Next Scor 0
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");
unsigned 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;
}