func_code_string: #include <bits/stdc++.h>   using namespace std;   long long x[5003], a[5003], b[5003], c[5003], d[5003];   vector<int> path;   long long weight[5003][5003];   long long edge(int i, int j) {     long long ans = abs(x[i] - x[j]);     if (j < i) ans += (c[i] + b[j]);     if (i < j) ans += (d[i] + a[j]);     return ans;   }   int main() {     int n, s, e;     cin >> n >> s >> e;     for (int i = 1; i <= n; i++) cin >> x[i];     for (int i = 1; i <= n; i++) cin >> a[i];     for (int i = 1; i <= n; i++) cin >> b[i];     for (int i = 1; i <= n; i++) cin >> c[i];     for (int i = 1; i <= n; i++) cin >> d[i];     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) weight[i][j] = edge(i, j);     long long ans = weight[s][e];     path.push_back(s);     path.push_back(e);     for (int i = 1; i <= n; i++) {       if (i == s || i == e) continue;       int insert_at = 0;       long long best = 1e12;       for (int j = 0; j < path.size() - 1; j++) {         long long temp = weight[path[j]][i] + weight[i][path[j + 1]] -                          weight[path[j]][path[j + 1]];         if (temp < best) {           best = temp;           insert_at = j;         }       }       ans += best;       vector<int>::iterator ins = find(path.begin(), path.end(), path[insert_at]);       ins++;       path.insert(ins, i);     }     cout << ans << endl;   }   