Problem: You are given four different integer points , , and on grid.
In one step you can choose one of the points and move it in one of four directions by one. In other words, if you have chosen point you can move it to , , or .
Your goal to move points in such a way that they will form a square with sides parallel to and axes (a square with side is allowed).
What is the minimum number of steps you need to make such a square?
Input Format: The first line contains a single integer () — the number of test cases.
Each test case consists of four lines. Each line contains two integers and () — coordinates of one of the points .
All points are different in one test case.
Output Format: For each test case, print the single integer — the minimum number of steps to make a square.
Note: In the first test case, one of the optimal solutions is shown below:
In the second test case, one of the optimal solutions is shown below:
In the third test case, one of the optimal solutions is shown below: