[Solution] Change Row and Column Both CodeChef Solution
There is a grid with rows numbered to from top to bottom, and columns to from left to right. Each cell is identified by a pair which means that the cell is located at row and column .
If Chef's current location is , then in one move Chef can go to if both of the following are satisfied:
👇👇👇👇👇
Determine the minimum number of moves required to go from to .
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains four integer , , , — the coordinates of
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
- the starting and ending cells.
Output Format
For each testcase, output the minimum number of moves required to go from to .
No comments:
Post a Comment