Source Code
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,m;cin>>n>>m>>t;
    int pro=0,ans=0;
    while(pro!=n){
        ans++;
        if(ans%t==0){
            pro++;
            sn++;
        }
        if(ans%m==0){
            pro++;
            sm++;
        }

    }
    cout<<ans;

}
Copy
Hurry up X_404
GNU G++17
0 ms
0 KB
Compilation Error