CodechefSep 02, 2025

Chef gives Party

Hazrat Ali

Codechef

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, yesyEsYes will be considered identical).

Constraints

  • 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

Solution
t = int(input())

for _ in range(t):
    n, x, k = map(int, input().split())
   
    total_cost = n * x
   
    if k >= total_cost:
        print("YES")
    else:
        print("NO")




Comments