Check if given four points form a square
Submissions: 9270   Accuracy:

32.57%

  Difficulty: Basic   Marks: 1

Given coordinates of four points in a plane, find if the four points form a square or not.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains 4 space separated integer points b , c , d

Output:
For each test case print 1 if the four points form a square else print 0.
Remember to output the answer of each test case in a new line.

Constraints:
1 <= T <= 200
1 <= a,b,c,d <= 100

Example:
Input
:
2
20 20 20 10 10 20 10 10
10 10 10 10 20 10 20 30
Output:
1
0

** For More Input/Output Examples Use 'Expected Output' option **

Author: Shubham Joshi 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.