GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Wednesday, 20 July 2022

[Solution] Buy Lamps CodeChef Solution



An electronics shop sells red and blue lamps. A red lamp costs X rupees and a blue lamp costs Y rupees.

Chef is going to buy exactly N lamps from this shop. Find the minimum amount of money Chef needs to pay such that at least K of the lamps bought are red.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇


  • Each test case consists of a single line containing four space-separated integers N,K,X,Y.

Output Format

For each test case, output on a new line the minimum amount of money Chef needs to pay in order to

Passes for Fair CodeChef Solution

Fill Candies CodeChef Solution

Buy Lamps CodeChef Solution

Make Palindrome 2 CodeChef Solution

Fill The Grid CodeChef Solution

Positive array CodeChef Solution

Strict Permutation CodeChef Solution

 buy N lamps such that at least K of the lamps bought are red.

Constraints

  • 1T103
  • 1N108
  • 0KN
  • 1X,Y10

No comments:

Post a Comment