Expiring Bread CodeChef Solution

Problem – Expiring Bread CodeChef Solution

Eikooc loves bread. She has N loaves of bread, all of which expire after exactly M days. She can eat upto K 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 T – the number of test cases. Then the test cases follow.
  • Each test case consists of a single line containing three integers NM and K – 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≤T≤1000
  • 1≤N,M,K≤100

Sample 1:

Input: 3
100 100 1
9 2 5
19 6 3
Output: 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.

Expiring Bread CodeChef Solution in Java

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
		int t = sc.nextInt();
	
		
		while(t-->0){
		    int a=sc.nextInt();
		    int b=sc.nextInt();
		    int c=sc.nextInt();
		    if(a<=b*c)
		    System.out.println("yes");
		    else
		    System.out.println("no");
		    
		    
		}
	}
}

Expiring Bread CodeChef Solution in C++14

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	    int n, m, k;
	    cin>>n>>m>>k;
	    if((m*k)>=n){
	        cout<<"Yes"<<endl;
	    }
	    else{
	        cout<<"No"<<endl;
	    }
	}
	return 0;
}

Expiring Bread CodeChef Solution in Pyth 3

t=int(input())
for i in range(t):
    a,b,c=map(int,input().split())
    if b*c>=a:
        print("YES")
    else:
        print("NO")
Expiring Bread CodeChef Solution Review:

In our experience, we suggest you solve this Expiring Bread CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Expiring Bread CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Expiring Bread CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.