Cod sursa(job #38063)

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