GUPTA MECHANICAL

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

Wednesday 29 June 2022

[Solution] Chef and his Apps CodeChef Solution


Chef's phone has a total storage of S MB. Also, Chef has 2 apps already installed on his phone which occupy X MB and Y MB respectively.

He wants to install another app on his phone whose memory requirement is Z MB. For this, he might have to delete the apps already installed on his phone. Determine the minimum number of apps he has to delete from his phone so that he has enough memory to install the third app.

Input Format

  • The first line contains a single integer T — the number of test cases. Then the test cases follow.
Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

  • The first and only line of each test case contains four integers S,X,Y and Z — the total memory of Chef's phone, the memory occupied by the two already installed apps and the memory required by the third app.

Output Format

For each test case, output the minimum number of apps Chef has to delete from his phone so that

Best of Two CodeChef Solution

Chef and his Apps CodeChef Solution

Change Row and Column Both CodeChef Solution

Adjacent Sum Parity CodeChef Solution

Retrieve the Array CodeChef Solution

Even Equal Odd CodeChef Solution

Xor and Multiply CodeChef Solution

KBG and GN-Theory CodeChef Solution

 he can install the third app.

Constraints

  • 1T1000
  • 1S500
  • 1XYS
  • X+YS

No comments:

Post a Comment