Problem
Chef needs to satisfy the following three criteria to get gift:
- Solve at least problems on Codechef.
- Have at least current rating on Codechef.
- Make his last submission at most months ago.
You are given the number of problems solved by Chef (), his current rating () and the information that he made his last submission months ago. Determine whether he will get the gift.
Input
- The first line of the input contains a single integer denoting the number of test cases. The description of test cases follows.
- The first and only line of each test case contains six space-separated integers , , , , and .
Output
For each test case, print a single line containing the string "YES"
if Chef will get the gift or "NO"
if he will not.
You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).
Constraints
Example Input
4
20 50 2100 1900 6 6
50 20 1900 1900 5 5
20 20 1900 1900 1 6
27 27 1920 1920 3 3
Example Output
NO
NO
NO
YES
### Explanation
Example case 1: Chef's rating is less than the minimum required rating.
Example case 2: Chef has solved a smaller number of problems than the minimum required number.
Example case 3: Chef's last submission was made before the allowed period.
Example case 4: All three conditions are met.
Program :
#include <stdio.h>
int main(void) {
// your code goes here
int a,b,c,d,e,f,n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d %d %d %d %d %d ",&a,&b,&c,&d,&e,&f);
if( b >= a && d >= c && f <= e)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
0 Comments