public void solve() throws IOException {
    int nights = nextInt();
    for (int t = 0; t < nights; t++) {
      int n = nextInt();
      List<Point> points = new ArrayList<Point>();
      for (int i = 0; i < n; i++) {
        points.add(new Point(nextInt(), nextInt()));
      }
      
      int total = 0;
      for (Point p : points) {
        Map<Double, Integer> counts = new HashMap<Double, Integer>();
        
        for (Point q : points) {
          if (p == q) {
            continue;
          }
          
          double distance = distance(p, q);
          if (!counts.containsKey(distance)) {
            counts.put(distance, 1);
          } else {
            counts.put(distance, counts.get(distance) + 1);
          }
        }
        
        for (int count : counts.values()) {
          if (count >= 2) {
            total += count * (count - 1) / 2;
          }
        }
      }
      System.out.format("Case #%d: %d%n", t + 1, total);
    }
  }