Help me in solving GDTURN problem

My issue

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
	{
       Scanner scan=new Scanner(System.in);
       int T=scan.nextInt();
       int X=scan.nextInt();
       int Y=scan.nextInt();
       for(int i=1;i<=T;i++){
       if(X+Y>6){
           System.out.println("YES");
       }
       else{
           System.out.println("NO");
       }
	}
}
}

Problem Link: GDTURN Problem - CodeChef

Hello, that’s a right ans. for this problem


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
	{
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		while(t-->0){
		    int x=sc.nextInt();
		    int y=sc.nextInt();
		    if(x+y>6){
		        System.out.println("YES");
		    }else{
		        System.out.println("No");
		    }
		}
		
	}
}

You take input outside the loop that cause wrong answer.