Advertisement
rengetsu

Codeforces_460A

Aug 7th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. //Codeforces Round 460A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, m, answ=0, ch=0;
  7.     cin >> n >> m;
  8.     while(n)
  9.     {
  10.         ch++;
  11.         answ++;
  12.         n--;
  13.         if(ch%m==0){n++;}
  14.     }
  15.     cout << answ;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement