Source Code
#include<iostream>

using namespace std;
int main() {

int n ,x,y; cin>>n>>x>>y;
int tim=0; 
for(int i=1 ;n>0;i++){
if(i%x==0)
n--;

if(i%y==0)
n--;
tim =i;
}

cout<<tim;
}
Copy
Hurry up momo
GNU G++17
1100 ms
396 KB
Time Limit Exceeded
Test Case #1
0 ms
364 KB
Accepted
Input
10 2 3
Output
12
Judge Output
12
Checker Message
"12"
Test Case #2
1100 ms
396 KB
Time Limit Exceeded
Input
1000000000 1000000000 1000000000
Output

Judge Output
500000000000000000
Checker Message