Algorithm
problem Link : https://www.codechef.com/problems/SUPCHEF?tab=statement
Problem
Chef has an exam which will start exactly minutes from now. However, instead of preparing for his exam, Chef started watching Season- of Superchef. Season- has episodes, and the duration of each episode is minutes.
Will Chef be able to finish watching Season- strictly before the exam starts?
Please read the explanations of the sample test cases carefully.
Input Format
- The first line contains an integer denoting the number of test cases. test cases then follow.
- The first and only line of each test case contains space separated integers , and .
Output Format
For each test case, output on one line YES if it is possible to finish Season-1 strictly before the exam starts, or NO if it is not possible to do so.
Output is case insensitive, which means that "yes", "Yes", "YEs", "no", "nO" - all such strings will be acceptable.
Constraints
Sample 1:
3 10 1 10 25 2 10 15 2 10
NO YES NO
Explanation:
Test Case : The duration of the only episode is minutes, and the exam starts exactly after minutes. So, Chef will not be able to finish watching Season- strictly before the exam starts.
Test Case : There are two episodes in Season-, each of duration minutes. Therefore, Chef will require minutes to finish watching Season-. As the exam starts after minutes, Chef will be able to finish watching Season- strictly before the exam starts.
Test Case : There are two episodes in Season-, each of duration minutes. Therefore, Chef will require minutes to finish watchin Season-. As the exam starts after minutes, Chef will not be able to finish watching Season- strictly before the exam starts.
CodeChef for Faculty
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h>
int main()
{
int t,m,n,k;
scanf("%d",&t);
while(t--)
{
scanf("%d %d %d",&m,&n,&k);
if(m>n*k) printf("Yes\n");
else printf("No\n");
}
}
Copy The Code &
Try With Live Editor
Input
10 1 10
25 2 1
15 2 10
Output
YES
NO
Demonstration
CodeChef solution SUPCHEF - The Preparations Codechef solution in C,C++