Help me in solving CHEFAPPS problem

My issue

i think the code is correct but still it is wrong plz correct it

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int s,x,y,z;
	    
	    cin>>s>>x>>y>>z;
	   if(s<x+y+z){
	       if(s>x+z||s>y+z)
	           cout<<"1"<<endl;
	       else
	       cout<<"2"<<endl;
	   }
	   else
	   cout<<"0"<<endl;
	   
	    
	}
	return 0;
}

Problem Link: CHEFAPPS Problem - CodeChef

@piyushmittal27
one mistake u have to do s>=x+z || s>=y+z equals sign is missing

1 Like