GUPTA MECHANICAL

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

Wednesday, 1 June 2022

[Solution] Equal Integers CodeChef Solution | CodeChef Problem Solution 2022

Chef has two integers X and Y. Chef wants to perform some operations to make X and Y equal. In one operation, Chef can either:

  • set X:=X+1
  • or set Y:=Y+2

Find the minimum number of operations required 

Solution Click Below:-  CLICK HERE


to make X and Y equal.

Input Format

  • The first line contains a single integer T — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains two space separated integers X and Y.

Output Format

For each test case, print the minimum number of operations required to make X and Y equal.

Constraints

  • 1T104

No comments:

Post a Comment