Algorithm


problem Link : https://www.codechef.com/problems/EXPIRY 

Problem

Eikooc loves bread. She has  loaves of bread, all of which expire after exactly  days. She can eat upto  loaves of bread in a day. Can she eat all the loaves of bread before they expire?

Input Format

  • The first line contains a single integer  - the number of test cases. Then the test cases follow.
  • Each test case consists of a single line containing three integers  and  - the number of loaves of bread Eikooc has, the number of days after which all the breads will expire and the number of loaves of bread Eikooc can eat in a day.

Output Format

For each test case, output Yes if it will be possible for Eikooc to eat all the loaves of bread before they expire. Otherwise output No.

You may print each character of Yes and No in uppercase or lowercase (for example, yesyEsYES will be considered identical).

Constraints

  • 1≤�≤1000
  • 1≤�,�,�≤100

Sample 1:

Input
 
Output
 
3
100 100 1
9 2 5
19 6 3
Yes
Yes
No

Explanation:

Test case 1: Eikooc can eat one loaf of bread per day for 100 days. Thus none of the bread expires.

Test case 2: Eikooc can eat 5 loaves of the first day and 4 loaves on the second day. Thus none of the bread expires.

Test case 3: There is no way Eikooc can consume all the loaves of bread before it expires.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>

int main(void) {
	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">;
	}
	return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
3
100 100 1
9 2 5
19 6 3

Output

x
+
cmd
Yes
Yes
No
Advertisements

Demonstration


CodeChef solution XPIRY  - Expiring Bread Codechef solution in C,C++

Previous
CodeChef solution FLOW002 - Find Remainder Codechef solution in C,C++
Next
CodeChef solution BROKENPHONE - Broken Phone Codechef solution in C,C++