Cod sursa(job #59671)

Utilizator bobo_2dan horia bobo_2 Data 10 mai 2007 08:42:47
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include<fstream.h>

unsigend 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;
}