GUPTA MECHANICAL

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

Friday 8 July 2022

[Solution] Chef and Candies CodeChef Solution 2022


There are N children and Chef wants to give them 1 candy each. Chef already has X candies with him. To buy the rest, he visits a candy shop. In the shop, packets containing exactly 4 candies are available.

Determine the minimum number of candy packets Chef must buy so that he is able to give 1 candy to each of the N children.

Input Format

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


  • The first and only line of each test case contains two integers N and X — the number of children and the number of candies Chef already has.

Output Format

For each test case, output the minimum number of candy packets Chef must buy so that he is able

Bidding CodeChef Solution 

Pass the Exam CodeChef Solution

Chef and Candies CodeChef Solution

Journey of the Knight CodeChef Solution

Slow Solution CodeChef Solution 

Game of Piles Version 1 CodeChef Solution

Find A, B, C CodeChef Solution

Largest Square in the garden CodeChef Solution

Game of Piles Version 2 CodeChef Solution


 to give 1 candy to each of the N children.

Constraints

  • 1T1000

No comments:

Post a Comment