From 9d54d30d765986110897590c31e146f3c32e8388 Mon Sep 17 00:00:00 2001 From: Mehak <77800400+Mehak0111@users.noreply.github.com> Date: Sun, 27 Feb 2022 16:14:20 +0530 Subject: [PATCH] Add files via upload --- Mehak_gameofcodes_ps-1.cpp | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Mehak_gameofcodes_ps-1.cpp 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