GUPTA MECHANICAL

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

Sunday, 3 July 2022

[Solution] Chef Drinks Tea CodeChef Solution | CodeChef Solution


Chef has planned that he will drink exactly X liters of tea daily. He has an empty jar having a capacity of Y liters.

Chef can visit the tea shop to refill the jar. In each refill, the jar is completely filled to the brim and Chef is charged Z rupees.

Chef wonders what is the minimum amount of money he has to pay for drinking exactly X liters of tea daily.

Input Format

  • First line will contain T, number of test cases. Then the test cases follow.
Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

  • Each test case contains of a single line of input, three space-separated integers XY, and Z denoting the amount of tea Chef has to drink daily, the capacity of his jar and the cost of


  •  refilling his jar.

Output Format

For each test case, output in a single line, the minimum amount Chef has to pay.

Constraints

  • 1T1000

No comments:

Post a Comment