UPDATE1 : (I submitted again and now it works ?? ) :
Hooray, you did it!
Hi community, here the probable bug I found
Describe your issue
The output is incorrect. I ntimes checked it to make sure. I believe my code is right. I checked with chatgpt the logic and I can’t find the mistake so it’s has to be a bug or I will delete my post.
Screenshot
verify it with chatpt :
4
5 2 1 6
7 9 7 2
20 8 10 12
20 10 11 12
Sample Input
4
5 2 1 6
7 9 7 2
20 8 10 12
20 10 11 12
Your Output
NO
YES
YES
NO
Failed test case for previous submission
Solution Failed on following Input
1
7 1 4 2
Your Output
NO
Expected Output
YES
Additional info
that’s my code :
#include <stdio.h>
int main() {
int t;
scanf("%d", & t);
while (t--) {
int W, X, Y, Z;
scanf("%d%d%d%d", & W, & X, & Y, & Z);
if (W == (X + Y + Z)) {
printf("YES\n");
} else if ((W == X + Y) || (W == Y + Z) || (W == X + Z)) {
printf("YES\n");
} else if (W == X || W == Y || W == Z) {
printf("YES\n");
} else {
printf("NO\n");
}
}
return 0;
}
I believe it’s the second problem I found mistake on it, but let’s clarify this one first please