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-1 of Superchef. Season-1 has  episodes, and the duration of each episode is  minutes.

Will Chef be able to finish watching Season-1 strictly before the exam starts?

Note: 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 3 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

  • 1≤�≤104
  • 1≤�≤109
  • 1≤�,�≤104

Sample 1:

Input
 
Output
 
3
10 1 10
25 2 10
15 2 10
NO
YES
NO

Explanation:

Test Case 1: The duration of the only episode is 10 minutes, and the exam starts exactly after 10 minutes. So, Chef will not be able to finish watching Season-1 strictly before the exam starts.

Test Case 2: There are two episodes in Season-1, each of duration 10 minutes. Therefore, Chef will require 10+10=20 minutes to finish watching Season-1. As the exam starts after 25 minutes, Chef will be able to finish watching Season-1 strictly before the exam starts.

Test Case 3: There are two episodes in Season-1, each of duration 10 minutes. Therefore, Chef will require 10+10=20 minutes to finish watchin Season-1. As the exam starts after 15 minutes, Chef will not be able to finish watching Season-1 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

x
+
cmd
3
10 1 10
25 2 1
15 2 10

Output

x
+
cmd
NO
YES
NO
Advertisements

Demonstration


CodeChef solution SUPCHEF  - The Preparations Codechef solution in C,C++

Previous
CodeChef solution WORDLE - Wordle Codechef solution in C,C++
Next
CodeChef solution BMI - Body Mass Index Codechef solution in C,C++