304 North Cardinal St.
Dorchester Center, MA 02124

# Chef gives Party CodeChef Solution

## Problem – Chef gives Party CodeChef Solution

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.

### Input Format

• The first line contains a single integer T – the number of test cases. Then the test cases follow.
• The first and only line of each test case contains the three integers NX, and K – the number of Chef’s friends, the cost of each burger, and the total money Chef has, respectively.

### Output Format

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).

• 1≤T≤1000
• 1≤N,X≤100
• 1≤K≤10000

### Sample 1:

``````Input: 4
5 10 70
5 10 40
10 40 400
14 14 150
Output: YES
NO
YES
NO``````

### Explanation:

• Test case 1: Chef has 5 friends. The cost of buying a burger for each of them will be 10×5=50 while Chef has 70 rupees. Therefore, he can buy a burger for all of them.
• Test case 2: Chef has 5 friends. The cost of buying a burger for each of them will be 10×5=50 while Chef has 40 rupees. Therefore, he can not buy a burger for all of them.
• Test case 3: Chef has 10 friends. The cost of buying a burger for each of them will be 40×10=400 and Chef has 400 rupees. Therefore, he can buy a burger for all of them.
• Test case 4: Chef has 14 friends. The cost of buying a burger for each of them will be 14×14=196 while Chef has 150 rupees. Therefore, he can not buy a burger for all of them.

### Chef gives Party CodeChef Solution in C++17

``````#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;
}
``````

### Chef gives Party 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();

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");
}
}
}
}
``````

### Chef gives Party CodeChef Solution in Pyth 3

``````t=int(input())
for i in range(t):
n,x,k=map(int,input().split(" "))
if k>=n*x:
print("yes")
else:
print("no")
``````
##### Chef gives Party CodeChef Solution Review:

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

Find on CodeChef

##### Conclusion:

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 >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions