func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int comp(pair<long long int, long long int> a,                      pair<long long int, long long int> b) {     if (a.first != b.first) return a < b;     return a.second < b.second;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int n;     cin >> n;     vector<pair<long long int, long long int>> v;     for (long long int i = 0; i < n; i++) {       long long int x, y;       cin >> x >> y;       x += 1000;       y += 1000;       v.push_back({x, y});     }     sort(v.begin(), v.end(), comp);     long long int cnt = 0;     for (long long int i = 0; i < n; i++) {       for (long long int j = i + 1; j < n; j++) {         if (((((v[i].first + v[j].first)) % 2 == 0) &&              (((v[i].second + v[j].second)) % 2 == 0))) {           long long int x1, y1;           x1 = (v[i].first + v[j].first) / 2;           y1 = (v[i].second + v[j].second) / 2;           long long int lo = i + 1, hi = j - 1, id = -1;           while (lo <= hi) {             long long int mid = (lo + hi) / 2;             if (v[mid].first >= x1) {               id = mid;               hi = mid - 1;             } else if (v[mid].first < x1)               lo = mid + 1;           }           if (id != -1) {             while (v[id].first == x1 && id < n) {               if (v[id].second == y1) {                 cnt++;                 break;               }               id++;             }           }         }       }     }     cout << cnt;   }   