#include #include #include #define int long long using namespace std; vector stars; int binary(int f, int t, int value) { if (f > t) { return -1; } int mid = (f + t)/2; if(stars[mid] == value) { return mid; } if(stars[mid] < value) { return binary(mid + 1, t, value); } else { return binary(f, mid - 1, value); } } signed main() { ios_base::sync_with_stdio(0); int counta; cin >> counta; for(int i =0 ; i < counta; ++i) { int x, y; cin >> x >> y; x += 1000; y += 1000; stars.push_back(3000 * x + y); } sort(stars.begin(), stars.end()); int result = 0; for(int i = 1; i < counta; ++i) { int dif = stars[i] - stars[0]; bool correct = true; for(int j = 0; j < counta; ++j) { int index = binary(0, counta - 1, stars[j] + dif); if(index == -1) { index = binary(0, counta - 1, stars[j] - dif); } if(index == -1) { correct = false; break; } } if(correct) { result += 2; } } cout << result << endl; return 0; }