Hey guys,
so i passed the inititial constraint test,but it doesnt pass the original constraint. I’ve looked at other people’s successful codes and they are conceptually same.Can anyone point out whats the mistake in my solution.
Thanks in advance
Here’s my code:
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
ll n,a,b,k;
cin >> n >> a >> b >> k;
ll cnt =0;
cnt += n/a;
cnt += n/b;
cnt -= 2*n*__gcd(a,b)/(a*b);
if(k<=cnt){
cout << "Win" << endl;
}
else
cout << "Lose" <<endl;
}
}