Advertisement
Saleh127

CF 1085B

Oct 30th, 2020
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main ()
  4. {
  5. long long int a,b,c,d,e,f,i,j,k,n,l;
  6. cin>>n>>k;
  7. for(i=k-1;i>=1;i--)
  8. {
  9. if(n%i==0)
  10. {
  11. break;
  12. }
  13. }
  14. d=k*(n/i)+i;
  15. cout<<d<<endl;
  16. return 0;
  17. }
  18.  
Advertisement
RAW Paste Data Copied
Advertisement