From be3cfadb7fa57a1813cccbd3f9556505d8e7fb4f Mon Sep 17 00:00:00 2001 From: Tushar Date: Sun, 27 Feb 2022 16:58:14 +0530 Subject: [PATCH 1/3] Adding solution --- Problem Statement-1/Solution/solution.cpp | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Problem Statement-1/Solution/solution.cpp diff --git a/Problem Statement-1/Solution/solution.cpp b/Problem Statement-1/Solution/solution.cpp new file mode 100644 index 0000000..9e3db48 --- /dev/null +++ b/Problem Statement-1/Solution/solution.cpp @@ -0,0 +1,34 @@ +#include +using namespace std; + +unsigned long long gcd(unsigned long long int x, unsigned long long int y) +{ + if (y == 0) + return x; + return gcd(y, x % y); +} +unsigned long long lcm(unsigned long long int x, unsigned long long int y) +{ + return (x / gcd(x, y)) * y; +} + +int main() +{ + int t; + cin >> t; + while (t--) + { + unsigned long long int n, a, b, k, c, d, ans; + cin >> n >> a >> b >> k; + c = (n / a) + (n / b); + d = n / lcm(a, b); + ans = c - (2 * d); + if (ans >= k) + { + cout << "Win" << endl; + } + else + cout << "No" << endl; + } + return 0; +} From cbcee957389dc03e94fd2a29906e4d406f09a2ba Mon Sep 17 00:00:00 2001 From: Tushar Date: Sun, 27 Feb 2022 17:07:01 +0530 Subject: [PATCH 2/3] Solution added --- .../{solution.cpp => TusharChauhan_ProblemStatement-1_Ps-1.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Problem Statement-1/Solution/{solution.cpp => TusharChauhan_ProblemStatement-1_Ps-1.cpp} (100%) diff --git a/Problem Statement-1/Solution/solution.cpp b/Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp similarity index 100% rename from Problem Statement-1/Solution/solution.cpp rename to Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp From 4fe856261d3d9a28d157091b6e9482a4e6e2430b Mon Sep 17 00:00:00 2001 From: Tushar Date: Sun, 27 Feb 2022 17:37:55 +0530 Subject: [PATCH 3/3] solution added --- .../Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp b/Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp index 9e3db48..5b5ba58 100644 --- a/Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp +++ b/Problem Statement-1/Solution/TusharChauhan_ProblemStatement-1_Ps-1.cpp @@ -28,7 +28,7 @@ int main() cout << "Win" << endl; } else - cout << "No" << endl; + cout << "Lose" << endl; } return 0; }