Help me in solving TWODISH problem

My issue

i have some doubt in the problem ,can anyone please help me…

My code

#include <stdio.h>

int main(void) {
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int n,a,b,c;
        scanf("%d %d %d %d",&n,&a,&b,&c);
        if(a+b>=n && b>=n)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    
    }
    return 0;
}

Learning course: Level up from 1* to 2*
Problem Link: Two Dishes Practice Problem in Level up from 1* to 2* - CodeChef

@reddysanju_99
here , refer my c++ code for better understanding of the logic

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n,a,b,c;
	    cin>>n>>a>>b>>c;
	    int val;
	    if(c>=a)
	    {
	        val=min(c,b)+max(0,min(b-c,a));
	    }
	    else
	    {
	        val=min(a,b)+max(0,min(b-a,c));
	    }
	    if(val>=n)
	    cout<<"YES";
	    else
	    cout<<"NO";
	    cout<<endl;
	}
	return 0;
}