{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"A square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the same polygon. It is not the only polygon with the latter property, however, as a regular octagon also has this property. \r\u003cbr\u003e\r\u003cbr\u003eSo we all know what a square looks like, but can we find all possible squares that can be formed from a set of stars in a night sky? To make the problem easier, we will assume that the night sky is a 2-dimensional plane, and each star is specified by its x and y coordinates. \r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of a number of test cases. Each test case starts with the integer n (1 \u0026lt;\u003d n \u0026lt;\u003d 1000) indicating the number of points to follow. Each of the next n lines specify the x and y coordinates (two integers) of each point. You may assume that the points are distinct and the magnitudes of the coordinates are less than 20000. The input is terminated when n \u003d 0. "}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print on a line the number of squares one can form from the given stars. "}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n1 0\r\n0 1\r\n1 1\r\n0 0\r\n9\r\n0 0\r\n1 0\r\n2 0\r\n0 2\r\n1 2\r\n2 2\r\n0 1\r\n1 1\r\n2 1\r\n4\r\n-2 5\r\n3 7\r\n0 0\r\n5 2\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n6\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}