#include #include #include using namespace std; struct poi { int x; int y; friend bool operator<(const poi& a, const poi& b) { if (a.x == b.x) { return a.y < b.y; } return a.x < b.x; } }; int main() { int n; cin >> n; poi* a = (poi*)malloc(sizeof(poi) * n); set ss; for (int i = 0; i < n; i++) { cin >> a[i].x >> a[i].y; ss.insert(a[i]); } int possibs = 0; for (int i = 1; i < n; i++) { int vecx = a[i].x - a[0].x; int vecy = a[i].y - a[0].y; bool fail = false; for (int j = 0; j < n; j++) { poi lokfor; lokfor.x = a[j].x + vecx; lokfor.y = a[j].y + vecy; if (ss.find(lokfor) != ss.end()) { continue; } lokfor.x = a[j].x - vecx; lokfor.y = a[j].y - vecy; if (ss.find(lokfor) != ss.end()) continue; fail = true; break; } if (fail) continue; else possibs += 2; } cout << possibs << endl; return 0; }