func_code_string: #include <bits/stdc++.h>   using namespace std;   const long double eps = 1e-9;   const int inf = (1 << 30) - 1;   const long long inf64 = ((long long)1 << 62) - 1;   const long double pi = 3.1415926535897932384626433832795;   const string task =   ;   template <class T>   T sqr(T first) {     return first * first;   }   long long gcd(long long a, long long b) {     if (a == 0) return b;     return gcd(b % a, a);   }   pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {     return make_pair(a.first - b.first, a.second - b.second);   }   pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {     return make_pair(a.first + b.first, a.second + b.second);   }   long long dist(pair<int, int> a, pair<int, int> b) {     return sqr(a.first - b.first) + sqr(a.second - b.second);   }   const int nmax = 1010;   pair<int, int> p[nmax];   int n, k, m;   pair<long long, pair<int, int> > e[nmax * nmax];   pair<int, int> die[nmax * 40];   int res[nmax];   int ord[nmax];   vector<int> g[nmax];   int cnt;   int deg[nmax];   set<pair<int, int> > alive;   void kill(int v) {     res[v] = 1;     alive.erase(make_pair(-deg[v], v));     for (int i = 0; i < (int)(g[v].size()); i++) {       int u = g[v][i];       if (alive.count(make_pair(-deg[u], u))) {         alive.erase(make_pair(-deg[u], u));         deg[u]--;         if (deg[u] > 0) alive.insert(make_pair(-deg[u], u));       }     }   }   void rekill(int v) {     res[v] = 0;     for (int i = 0; i < (int)(g[v].size()); i++) {       int u = g[v][i];       if (alive.count(make_pair(-deg[u], u)) || deg[u] == 0) {         alive.erase(make_pair(-deg[u], u));         deg[u]++;         alive.insert(make_pair(-deg[u], u));       }     }     alive.insert(make_pair(-deg[v], v));   }   bool go(int kl) {     if (kl > k) return 0;     if (alive.size() == 0) return 1;     pair<int, int> now = *alive.begin();     int v = now.second;     if (alive.size() / (-now.first + 1) + kl > k) return 0;     if (now.first == -1) {       int w = alive.size();       assert(w % 2 == 0);       if (kl + w / 2 > k) return 0;       while (alive.size() > 0) {         pair<int, int> now = *alive.begin();         kill(now.second);         kl++;       }       assert(kl <= k);       return 1;     }     if (kl + deg[v] <= k) {       vector<int> buf;       int nkl = kl;       for (int i = 0; i < (int)(g[v].size()); i++)         if (res[g[v][i]] == 0) {           buf.push_back(g[v][i]);           kill(g[v][i]);           nkl++;         }       if (go(nkl)) return 1;       for (int i = (int)(buf.size()) - 1; i >= 0; i--) rekill(buf[i]);     }     if (kl + 1 <= k) {       kill(v);       if (go(kl + 1)) return 1;       rekill(v);     }     return 0;   }   bool check(int st) {     st++;     int e1 = 0;     for (int i = st; i < m; i++) die[e1++] = e[i].second;     for (int i = 0; i < (int)(n); i++) g[i].clear();     for (int i = 0; i < (int)(e1); i++) {       g[die[i].first].push_back(die[i].second);       g[die[i].second].push_back(die[i].first);     }     for (int i = 0; i < (int)(n); i++) deg[i] = g[i].size();     alive.clear();     for (int i = 0; i < (int)(n); i++)       if (deg[i] > 0) alive.insert(make_pair(-deg[i], i));     memset(res, 0, sizeof res);     return go(0);   }   int main() {     cin >> n >> k;     for (int i = 0; i < (int)(n); i++) scanf( %d %d , &p[i].first, &p[i].second);     m = 0;     for (int i = 0; i < (int)(n); i++)       for (int j = i + 1; j < n; j++)         e[m++] = make_pair(dist(p[i], p[j]), make_pair(i, j));     sort(e, e + m);     int r = m - 1, l = max(0, r - n * k);     while (l < r) {       int mid = (l + r) / 2;       if (check(mid))         r = mid;       else         l = mid + 1;     }     check(l);     vector<int> buf;     for (int i = 0; i < (int)(n); i++)       if (res[i] > 0)         res[i] = 1;       else         buf.push_back(i);     while (buf.size() > n - k) {       res[buf.back()] = 1;       buf.pop_back();     }     for (int i = 0; i < (int)(n); i++)       if (res[i]) cout << i + 1 <<    ;     cout << endl;     return 0;   }   