Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef wants to give a burger party to all his N friends i.e. he wants to buy one burger for each of his friends.
The cost of each burger is X rupees while Chef has a total of K rupees.
Determine whether he has enough money to buy a burger for each of his friends or not.
For each test case, output YES
if the Chef can give a party to all his N friends. Otherwise, output NO
.
You may print each character of YES
and NO
in uppercase or lowercase (for example, yes
, yEs
, Yes
will be considered identical).
Input: 4
5 10 70
5 10 40
10 40 400
14 14 150
Output: YES
NO
YES
NO
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int N,X,K,H;
cin>>N>>X>>K;
H=N*X;
if(H<=K)
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}
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();
for (int i=0;i<t ;i++ )
{
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a*b<=c)
{
System.out.println("YES");
}
else if(a*b>=c)
{
System.out.println("NO");
}
}
}
}
t=int(input())
for i in range(t):
n,x,k=map(int,input().split(" "))
if k>=n*x:
print("yes")
else:
print("no")
In our experience, we suggest you solve this Chef gives Party 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 Chef gives Party CodeChef Solution
I hope this Chef gives Party 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 >>