#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::vector;
template <typename T>
T myabs(T t) {
  return t > 0 ? t : -t;
}
struct Point {
  int x, y;
  Point() {}
  Point(int a, int b) : x(a), y(b) {}
  Point operator+(const Point &pt) { return Point(x + pt.x, y + pt.y); }
  Point operator-(const Point &pt) { return Point(x - pt.x, y - pt.y); }
  Point abs() {
    if (x > 0)
      return *this;
    else if (x == 0)
      return Point(x, myabs(y));
    else
      return Point(-x, -y);
  }
  bool operator<(const Point &pt) const {
    return x == pt.x ? y < pt.y : x < pt.x;
  }
};
map<Point, int> vecs;
long long getCntVecAndAdd(Point vec) {
  auto iter = vecs.find(vec);
  if (iter == vecs.end()) {
    vecs.emplace(vec, 1);
    return 0;
  } else {
    ++iter->second;
    return iter->second - 1;
  }
}
int main() {
  int n;
  cin >> n;
  long long res = 0;
  vector<Point> pts;
  for (int q = 0; q < n; ++q) {
    Point pt;
    cin >> pt.x >> pt.y;
    long long add = 0;
    for (int i = 0; i < q; ++i) {
      Point vec = (pt - pts[i]).abs();
      add += getCntVecAndAdd(vec);
    }
    res += add / 2;
    pts.push_back(pt);
  }
  cout << res << endl;
  return 0;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

You are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.

Input

The first line of the input contains integer n (1 ≤ n ≤ 2000) — the number of points.

Each of the next n lines contains two integers (xi, yi) (0 ≤ xi, yi ≤ 109) — the coordinates of the i-th point.

Output

Print the only integer c — the number of parallelograms with the vertices at the given points.

Example

Input

4
0 1
1 0
1 1
2 0


Output

1

### Response

```cpp
#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::vector;
template <typename T>
T myabs(T t) {
  return t > 0 ? t : -t;
}
struct Point {
  int x, y;
  Point() {}
  Point(int a, int b) : x(a), y(b) {}
  Point operator+(const Point &pt) { return Point(x + pt.x, y + pt.y); }
  Point operator-(const Point &pt) { return Point(x - pt.x, y - pt.y); }
  Point abs() {
    if (x > 0)
      return *this;
    else if (x == 0)
      return Point(x, myabs(y));
    else
      return Point(-x, -y);
  }
  bool operator<(const Point &pt) const {
    return x == pt.x ? y < pt.y : x < pt.x;
  }
};
map<Point, int> vecs;
long long getCntVecAndAdd(Point vec) {
  auto iter = vecs.find(vec);
  if (iter == vecs.end()) {
    vecs.emplace(vec, 1);
    return 0;
  } else {
    ++iter->second;
    return iter->second - 1;
  }
}
int main() {
  int n;
  cin >> n;
  long long res = 0;
  vector<Point> pts;
  for (int q = 0; q < n; ++q) {
    Point pt;
    cin >> pt.x >> pt.y;
    long long add = 0;
    for (int i = 0; i < q; ++i) {
      Point vec = (pt - pts[i]).abs();
      add += getCntVecAndAdd(vec);
    }
    res += add / 2;
    pts.push_back(pt);
  }
  cout << res << endl;
  return 0;
}

```