func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int x[2001], y[2001];   int p[2001], mn[2001];   int k[2001], c[2001];   bool used[2001][2001];   unsigned long long dst[2001][2001];   unsigned long long dist(int i, int j) {     return (unsigned long long)(k[i] + k[j]) *            (unsigned long long)(abs(x[i] - x[j]) + abs(y[i] - y[j]));   }   void init() {     for (int i = 0; i < n; i++) {       p[i] = i;       mn[i] = c[i];     }     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         dst[i][j] = dist(i, j);         dst[j][i] = dst[i][j];       }     }   }   struct vertex {     unsigned long long len;     int x, y;     vertex(){};     vertex(unsigned long long _len, int _x, int _y) {       len = _len;       x = _x;       y = _y;     }     bool operator<(vertex b) { return len < b.len; }   };   bool operator<(const vertex& a, const vertex& b) { return a.len < b.len; }   multiset<vertex> s;   int get_anc(int x) {     if (x == p[x]) return x;     return p[x] = get_anc(p[x]);   }   void unite(int x, int y) {     x = get_anc(x);     y = get_anc(y);     if (x == y) return;     if (x < y) swap(x, y);     p[x] = y;     mn[y] = min(mn[x], mn[y]);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 0; i < n; i++) {       cin >> x[i] >> y[i];     }     for (int i = 0; i < n; i++) cin >> c[i];     for (int i = 0; i < n; i++) cin >> k[i];     init();     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         s.insert(vertex(dst[i][j], i, j));       }     }     unsigned long long ans = 0;     int conn = 0;     while (!s.empty()) {       vertex cur = *s.begin();       s.erase(s.begin());       unsigned long long curlen = cur.len;       int curx = cur.x, cury = cur.y;       if (get_anc(curx) == get_anc(cury)) continue;       if (curlen + min(mn[get_anc(curx)], mn[get_anc(cury)]) >           mn[get_anc(curx)] + mn[get_anc(cury)])         continue;       unite(curx, cury);       ans += curlen;       used[curx][cury] = used[cury][curx] = 1;       conn++;     }     vector<int> way;     for (int i = 0; i < n; i++) {       int x = get_anc(i);       if (c[i] == mn[x]) {         ans += c[i];         mn[i] = -1;         way.push_back(i + 1);       }     }     cout << ans << endl;     cout << way.size() << endl;     for (int i = 0; i < way.size(); i++) cout << way[i] <<    ;     cout << endl;     cout << conn << endl;     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         if (used[i][j]) cout << i + 1 <<     << j + 1 << endl;       }     }     return 0;   }   