Cod sursa(job #38075)

Utilizator RobytzzaIonescu Robert Marius Robytzza Data 25 martie 2007 14:38:50
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");
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;
}