


Let the input be [1,0,2,1] and [0,1,1,2].
So, the coordinates of the four points be [ {1, 0}, {0, 1}, {2, 1}, {1, 2} ]

From the above image, we can see that it is a square. Thus, the output will be ‘Yes’.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first line of each test case contains four space-separated integers representing x-coordinates of the four points.
The second line of each test case contains four space-separated integers representing y-coordinates of the four points.
For each test case, print ‘Yes’ if four points make a square otherwise print ‘No’.
Don’t print anything, just return True if four points make a square otherwise return False.
1 <= T <= 10^4
-10^9 <= xi, yi <= 10^9
Time limit: 1 sec
The simple approach would be checking the distance between each pair of points and confirming whether it is a square or not.