My issue
This approach looks fine. if (n % 2 == 0 && n%m == 0 && n >= 2 * m) {
System.out.println(“Yes”);
} else {
System.out.println(“No”);
}
Could someone let me know why test case is failing
My code
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for(int i=0; i<t; i++)
{
int n = read.nextInt();
int m = read.nextInt();
// Update the code below this line to solve this problem
if (n % 2 == 0 && n%m == 0 && n >= 2 * m) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
}
Learning course: Logic Building in Java
Problem Link: CodeChef: Practical coding for everyone