Cod sursa(job #42006)

Utilizator bobo_2dan horia bobo_2 Data 28 martie 2007 19:52:55
Problema Next Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream.h>

unsigned long long n,r,m,a,s;

ifstream f("next.in");
ofstream g("next.out");

int main()
{    f>>n;
     f>>r;
	  while(n%r>0)
	     {n-=1;
	      s++;
	     }

       r=r-s;
       
       m=n+r+s;
	g<<m;


     g.close();
     f.close();
     return 0;
}