Help me in solving COURSEREG problem

My issue

My code

#include <stdio.h>

int main(void) {
	int n,m,k,t; 
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d%d%d",&n,&m,&k);
	    if(m>=(n+k))
	    {
	        printf("\nYES");
	    }
	    else
	    {
	    printf("\nNo");
	    }
	}
	return 0;
}


Problem Link: COURSEREG Problem - CodeChef

@rajusriwastav4 Your logic is right. But you have to take n,m and k’s input in the while loop, instead of taking them out of the loop.
This would work -

int main(void) {
int t;
scanf(“%d”,&t);
while(t- -){
int n, m, k;
scanf(“%d%d%d”,&n,&m,&k);

if(m >= (n+k))
{
printf("YES\n);
}
else
{
printf("NO\n);
}
}
return 0;
}