#include <cstdio> #include <cstring> #include <iostream> using namespace std; int main(){ int n,m; scanf("%d%d",&n,&m); int s = n; int day = 1,c = 0; while(s--){ if(day % m == 0){ s++; //cout<<day<<endl; } day++; c++; } printf("%d\n",c); return 0; }
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int main(){ int n,m; scanf("%d%d",&n,&m); int s = n; int day = 1,c = 0; while(s--){ if(day % m == 0){ s++; //cout<<day<<endl; } day++; c++; } printf("%d\n",c); return 0; }