func_code_string: #include <bits/stdc++.h>   typedef struct {     int u, v, w;   } Edge;   int n;   int e;   Edge edges[100 * 99];   int d[100];   void bf(int s) {     int i, j;     for (i = 0; i < n; ++i) d[i] = 1000000000;     d[s] = 0;     for (i = 0; i < n - 1; ++i)       for (j = 0; j < e; ++j)         if (d[edges[j].u] + edges[j].w < d[edges[j].v])           d[edges[j].v] = d[edges[j].u] + edges[j].w;   }   int abs(int v) { return v < 0 ? -v : v; }   int a[100];   int cord[100][2];   int main() {     int c;     scanf( %d %d , &n, &c);     for (int i = 1; i <= n - 2; ++i) {       scanf( %d , &a[i]);     }     for (int i = 0; i < n; ++i) {       scanf( %d %d , &cord[i][0], &cord[i][1]);     }     int ei = 0;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < n; ++j) {         if (i == j) continue;         Edge ed;         ed.u = i;         ed.v = j;         ed.w = abs(cord[i][0] - cord[j][0]) + abs(cord[i][1] - cord[j][1]);         ed.w *= c;         ed.w -= a[j];         edges[ei++] = ed;       }     }     e = n * (n - 1);     bf(0);     printf( %d n , d[n - 1]);     return 0;   }   