func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, s, e;   int x[5555], a[5555], b[5555], c[5555], d[5555];   long long dist(int from, int to) {     return 1LL * abs(x[from] - x[to]) +            (from < to ? d[from] + a[to] : c[from] + b[to]);   }   int main() {     ios::sync_with_stdio(0);     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];     }     long long ans = dist(s, e);     list<int> path;     path.push_back(s);     path.push_back(e);     for (int i = 1; i <= n; ++i) {       if (i == s || i == e) continue;       list<int>::iterator best_it = path.begin();       long long next_ans = 1e18;       for (auto it = path.begin(); it != path.end(); ++it) {         if (*it == e) continue;         int from = *it;         auto next_iter = next(it);         int to = *next_iter;         long long current_ans =             ans - dist(from, to) + dist(from, i) + dist(i, to);         if (current_ans < next_ans) {           next_ans = current_ans;           best_it = next_iter;         }       }       path.insert(best_it, i);       ans = next_ans;     }     cout << ans;     return 0;   }   