Skip to content

Instantly share code, notes, and snippets.

@MohamedTaha98
Created July 24, 2017 11:19
Show Gist options
  • Save MohamedTaha98/59aec538a043f6a92bb8037ec4210953 to your computer and use it in GitHub Desktop.
Save MohamedTaha98/59aec538a043f6a92bb8037ec4210953 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main () {
int n, m;
cin >> n >> m;
int ans = n + (n - 1) / (m - 1);
cout << ans;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment