GUPTA MECHANICAL

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

Sunday 17 July 2022

[Solution] The Last Levels CodeChef Solution



Chef is playing a videogame, and is getting close to the end. He decides to finish the rest of the game in a single session.

There are X levels remaining in the game, and each level takes Chef Y minutes to complete. To protect against eye strain, Chef also decides that every time he completes 3 levels, he will take a Z minute break from playing. Note that there is no need to take this break if the game has been completed.

How much time (in minutes) will it take Chef to

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

complete the game?

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.

  • The first and only line of input will contain three space-separated integers XY, and Z.

Output Format

For each test case, output on a new line the answer — the length of Chef's gaming session.

Constraints

  • 1T100
  • 1X100
  • 5Y100

No comments:

Post a Comment