// Arup Guha
// 8/31/2016
// Solution to 2016 UCF Locals Problem: Don't Break the Ice

import java.util.*;

public class findt {

	public static int n;
	public static pt[] pts;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {

			n = stdin.nextInt();
			pts = new pt[n];

			// Read in points and sort.
			for (int i=0; i<n; i++) {
				double x = stdin.nextDouble();
				double y = stdin.nextDouble();
				pts[i] = new pt(x,y);
			}
			Arrays.sort(pts);

			int res = 0;

			// Go through all pairs of points (order matters) for this solution...
			for (int i=0; i<n; i++) {
				for (int j=0; j<n; j++) {
					if (i == j) continue;

					// Get the vector for long part of T.
					pt vect = (pts[i].getVect(pts[j])).getPerp();

					// Find both pts that are perpendicular from cross of T to short ends.
					pt end1 = pts[j].add(vect.multVect(.5));
					pt end2 = pts[j].add(vect.multVect(-.5));

					// Only add a T if both pts are in the set.
					if (Arrays.binarySearch(pts, 0, n, end1) >= 0 && Arrays.binarySearch(pts, 0, n, end2) >= 0)
						res++;
				}
			}
			// Our method of counting double counts T, so divide by 2.
			System.out.println("Set #"+loop+": "+res+"\n");
		}
	}
}

class pt implements Comparable<pt> {

	public double x;
	public double y;

	public pt(double myx, double myy) {
		x = myx;
		y = myy;
	}

	// Sort by x, breaking ties by y.
	public int compareTo(pt other) {
		if (x < other.x-1e-7) return -1;
		if (x > other.x+1e-7) return 1;
		if (y < other.y-1e-7) return -1;
		if (y > other.y+1e-7) return 1;
		return 0;
	}

	public pt getVect(pt dest) {
		return new pt(dest.x-x, dest.y-y);
	}

	public pt add(pt vect) {
		return new pt(x+vect.x,y+vect.y);
	}

	public pt getPerp() {
		return new pt(y, -x);
	}

	public pt getNeg() {
		return new pt(-x, -y);
	}

	public pt multVect(double c) {
		return new pt(c*x, c*y);
	}

	// Returns the dot product of this vector and v2.
	public double dot(pt v2) {
		return x*v2.x + y*v2.y;
	}
}