[Solution] Hungry Chef CodeChef Solution 2022
Problem
Chef is very hungry. So, Chef goes to a shop selling burgers. The shop has types of burgers:
- Normal burgers, which cost rupees each
- Premium burgers, which cost rupees each (where )
Chef has rupees. Chef wants to buy exactly burgers. He also wants to maximize the number of premium burgers he buys. Determine the number of burgers of both types Chef must buy.
Output if it is not possible for Chef to buy burgers.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains four space-separated integers , , and — the cost of a
- normal burger, the cost of a premium burger, the number of burgers Chef wants to buy and the amount of money Chef has.
Output Format
For each test case, output on a new line two integers: the number of normal burgers and the number of premium
Is it hot or cold CodeChef Solution
Maximise the Tastiness CodeChef Solution
N Buttons 1 Bulb CodeChef Solution
Valid Minimum CodeChef Solution
High Frequency CodeChef Solution
burgers Chef must buy satisfying the given conditions.
Output if he cannot buy burgers.
Explanation:
Test case : Chef has to buy normal burgers only. Even if he buys premium burger, he would not be able to buy burgers.
Test case : Chef can buy normal burgers and premium burgers.
Test case : It is not possible for Chef to buy burgers.
No comments:
Post a Comment