BEGINEER : Split Stones- Why Its showing wrong answer?

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®;

}
}

According to me, you assumed that the one stone value adds completely to the one of the remaining two values which is wrong. You should have only do the first if case only. Also you haven’t checked that the minimum of x&y is greater than or equal to the minimum of a,b&c. Then only you have the answer as yes otherwise no.