Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Problem Statement-1/Solution/Pavan_gameofcodes_Ps-1/Solution.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import java.util.Scanner;


public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

int nu_of_testcases = sc.nextInt();

while (nu_of_testcases != 0) {
int no_of_problems = sc.nextInt();
int divisor_a = sc.nextInt();
int divisor_b = sc.nextInt();
int solvemininum = sc.nextInt();

int anvisolve = 0;
int problem = 1;
while (problem != no_of_problems) {
if (problem % divisor_a != 0 && problem % divisor_b != 0) {
if (problem % divisor_a == 0 && problem % divisor_b != 0) {
anvisolve++;
}

if (problem % divisor_a != 0 && problem % divisor_b == 0) {
anvisolve++;
}

}

problem++;
}
nu_of_testcases--;
if(solvemininum >= anvisolve) {
System.out.println("Win");

} else {
System.out.println("Lose");

}
}
}
}