diff --git a/Mehak_gameofcodes_ps-1.cpp b/Mehak_gameofcodes_ps-1.cpp new file mode 100644 index 0000000..bbd333c --- /dev/null +++ b/Mehak_gameofcodes_ps-1.cpp @@ -0,0 +1,40 @@ +#include +using namespace std; + +int main() +{ + int a,b,n,k,t,countavni,countanuj; + cin>>t; + for(int i=1;i<=t;i++) + { + cin>>n; + cin>>a; + cin>>b; + cin>>k; + for(int j=0;j<=n;j++) + { + if (n%a==0 && n%b!=0) + { + countavni++; + } + + } + for(int m=0;m<=n;m++) + { + if (n%a!=0 && n%b==0) + { + countanuj++; + } + } + + int solved=countavni+countanuj; + if (solved>=k) + { + cout<<"Win"; + } + else + { + cout<<"Lose"; + } + } +} \ No newline at end of file