func_code_string: #include <bits/stdc++.h>   const int inf = 1e9;   using namespace std;   struct data {     int obj, pre, c;     double w;   } e[200500 * 2];   int head[200500], cur[200500], uu[200500], c[200500];   double dis[200500];   int n, tot = 1, s, t;   double ans = 0;   struct node {     double x, y;   } a[200500];   void insert(int x, int y, int c, double w) {     e[++tot].obj = y;     e[tot].pre = head[x];     e[tot].c = c;     e[tot].w = w;     head[x] = tot;     e[++tot].obj = x;     e[tot].pre = head[y];     e[tot].c = 0;     e[tot].w = -w;     head[y] = tot;   }   bool spfa() {     for (int i = 0; i <= t; i++) uu[i] = 0;     for (int i = 0; i <= t; i++) dis[i] = 1.0 * inf;     dis[0] = 0;     queue<int> q;     q.push(0);     while (!q.empty()) {       int u = q.front();       q.pop();       uu[u] = 1;       for (int j = head[u]; j; j = e[j].pre) {         int v = e[j].obj;         if (e[j].c > 0 && dis[v] > dis[u] + e[j].w + 1e-9) {           dis[v] = dis[u] + e[j].w;           if (uu[v] == 0) uu[v] = 1, q.push(v);         }       }       uu[u] = 0;     }     if (dis[t] >= 1.0 * inf) return 0;     return 1;   }   int dfs(int x, int mx) {     if (x == t || mx == 0) return mx;     uu[x] = 1;     int used = 0;     for (int j = cur[x]; j; j = e[j].pre) {       int v = e[j].obj;       if (fabs(dis[v] - (dis[x] + e[j].w)) < 1e-9 && e[j].c > 0 && uu[v] == 0) {         int w = dfs(v, min(e[j].c, mx - used));         ans += 1.0 * w * e[j].w;         e[j].c -= w;         e[j ^ 1].c += w;         used += w;         cur[x] = j;         if (used == mx) return used;       }     }     return used;   }   double sqr(double x) { return x * x; }   double D(node a, node b) { return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y)); }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %lf%lf , &a[i].x, &a[i].y);     s = 0;     t = 2 * n + 1;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++)         if (a[i].y > a[j].y) insert(i, j + n, 1, D(a[i], a[j]));     for (int i = 1; i <= n; i++) insert(s, i, 2, 0);     for (int i = 1; i <= n; i++) insert(i + n, t, 1, 0);     int flow = 0;     while (spfa()) {       for (int i = 0; i <= t; i++) cur[i] = head[i], uu[i] = 0;       flow += dfs(s, inf);     }     if (flow != n - 1)       puts( -1 );     else       printf( %.10lf n , ans);     return 0;   }   