Although it’s showing the correct result.
CODE-
import java.util.Scanner;
public class Stones
{
public static void main(String [] args){
Scanner sc= new Scanner(System.in);
int T = sc.nextInt();
String r="";
while(T–>0){
int a,b,c,x,y,s1,s2,s3;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
x = sc.nextInt();
y = sc.nextInt();
s1 = a+b;
s2 = b+c;
s3 = c+a;
if((a+b+c)==(x+y))
{if(s1==x||s2==x||s3==x){
if(a==y||b==y||c==y){r=r+“YES”+"\n";}
}
else if(s1==y||s2==y||s3==y){
if(a==x||b==x||c==x){r=r+“YES”+"\n";}
}
else
r=r+“NO”+"\n";}
else
r=r+“NO”+"\n";}
System.out.print®;
}
}