My issue
Output is correct for various test cases upon submitting The Answer is Getting Wrong
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner s=new Scanner(System.in);
int t=s.nextInt();
for(int i=0;i<t;i++){
int n=s.nextInt(),m=s.nextInt();
if (m==n){
System.out.println("YES");
break;}
else {
for(int j=1;j<=n;j++){
if(n-j==m+j){
System.out.println("Yes");
break;}
}
for (int k=1;k<=m;k++){
if(m-k==n+3*k){
System.out.println("YES");
break;}
else{
System.out.println("NO");
break;}
}
}
}}}
Problem Link: PR0BLEM Problem - CodeChef