Skip to content
neoideasblog

neoideasblog

  • Home
    • Privacy Policy
    • About Us
    • Contact Us
    • Terms
  • Trivia
  • Results
  • Admit Cards
  • Sitemaps
  • Toggle search form

Chef and Chocolates solution codechef- Chef has XX 5 rupee coins and YY 10 rupee coins. Chef goes to a shop to buy chocolates for Chefina where each chocolate costs ZZ rupees. Find the maximum number of chocolates that Chef can buy for Chefina.

Posted on June 1, 2022June 1, 2022 By Admin No Comments on Chef and Chocolates solution codechef- Chef has XX 5 rupee coins and YY 10 rupee coins. Chef goes to a shop to buy chocolates for Chefina where each chocolate costs ZZ rupees. Find the maximum number of chocolates that Chef can buy for Chefina.

Chef and Chocolates solution codechef

Chef has XX 5 rupee coins and YY 10 rupee coins. Chef goes to a shop to buy chocolates for Chefina where each chocolate costs ZZ rupees. Find the maximum number of chocolates that Chef can buy for Chefina.

Input Format

  • The first line contains a single integer TT — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains three integers XX, YY and ZZ — the number of 5 rupee coins, the number of 10 rupee coins and the cost of each chocolate.
ALSO READ:-   [Answer] A Trumpet Is In Which Family Of Musical Instruments?

Output Format

Chef and Chocolates solution codechef

For each test case, output the maximum number of chocolates that Chef can buy for Chefina.

Constraints

  • 1≤T≤1001≤T≤100
  • 1≤X,Y,Z≤10001≤X,Y,Z≤1000

Chef and Chocolates solution codechef

Sample Input 1 

4
10 10 10
3 1 8
8 1 3
4 4 1000

Sample Output 1 

15
3
16
0

Explanation

Chef and Chocolates solution codechef

Test case 11: Chef has 10⋅5+10⋅10=15010⋅5+10⋅10=150 rupees in total. Since each chocolate costs 1010 rupees, Chef can spend all 150150 rupees and buy 1515 chocolates for Chefina.

ALSO READ:-   [Question] When a horseshoe totally surrounds the stake, it's called what?

Test case 22: Chef has 3⋅5+1⋅10=253⋅5+1⋅10=25 rupees in total. Since each chocolate costs 88 rupees, Chef can buy a maximum of 33 chocolates for Chefina, leaving him with 11 rupee.

Test case 33: Chef has 8⋅5+1⋅10=508⋅5+1⋅10=50 rupees in total. Since each chocolate costs 33 rupees, Chef can buy a maximum of 1616 chocolates for Chefina, leaving him with 22 rupee.

Test case 44: Chef has 4⋅5+4⋅10=604⋅5+4⋅10=60 rupees in total. Since each chocolate costs 10001000 rupees, Chef can buy no chocolate for Chefina, leaving him with 6060 rupees.

ALSO READ:-   Infinity Area solution kickstart

SOLUTION

“Click Here“

Admin

I am the Founder and the creator of the blog neoideasblog.com where we share latest trivia questions and answers on a daily basis.

Trivia

Post navigation

Previous Post: Chef and Brain Speed solution codechef- In ChefLand, human brain speed is measured in bits per second (bps). Chef has a threshold limit of XX bits per second above which his calculations are prone to errors. If Chef is currently working at YY bits per second, is he prone to errors?
Next Post: Determine the Winner solution codechef-

Related Posts

[Question] Before becoming an actor, which man won a televised contest naming him "America’s Toughest Bouncer"? Trivia
[Question] 7. On cold days I love to come in, heat up a glass of water, add in two tablespoons of a brown powder, stir it up and top it with marshmallows. Trivia
[Question] Which company introduced the first credit card in 1950? Trivia
[Question] 8. Are you an expert putter or do you prefer to drive the ball? There are beautiful courses all over the world for those who are dedicated to my sport. For those who just like to have fun you can visit a putt-putt course and play miniature what? Trivia
[Question] Which of these nicknames does NOT apply to Frank Sinatra? Trivia
[Question] Which team won the highest-scoring game in NBA history? Trivia

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • June 2022
  • May 2022
  • April 2022

Categories

  • Admit Cards
  • Results
  • Trivia

Disclaimer

Disclaimer: Our website name Neoideasblog.com. we are just a news portal that covers various updates and stories.

Copyright © 2022 neoideasblog.

Powered by PressBook Grid Blogs theme