After thoroughly examining each iceberg, Bob the penguin has made a second revelation: some of the icebergs are in fact squares! This time, he has given you a list of icebergs, each with coordinates
, in clockwise order of vertices, starting from the top left. He would like to know how many of these icebergs are in the shape of a square (
sides of equal length). Keep in mind that the entire iceberg needs to be a square to count, rather than the portion above the x-axis.
Input Specification
The first line will contain the integer , representing the number of icebergs.
There will be groups of
lines, representing the coordinates of the icebergs, where each group of
being the coordinates of a single iceberg with points
.
Output Specification
Output one integer, representing the number of icebergs that are in the shape of square.
Constraints
For all test cases,
Sample Input
2
-3 2
7 2
7 -6
-3 -6
-1 1
1 1
1 -1
-1 -1
Sample Output
1
Sample Explanation
The first iceberg is in the shape of a rectangle, while the second is in the shape of a square.
Comments