func_code_string: #include <bits/stdc++.h>   const int mx = 2002;   const int inf = 1000 * 1000 * 1000;   using namespace std;   vector<int> adj[mx];   vector<long long> w[mx];   set<pair<long long, int> > s;   long long dist[mx];   bool mrk[mx];   void dijkstra() {     while (s.size()) {       pair<long long, int> p = *s.begin();       s.erase(s.begin());       int v = p.second;       mrk[v] = 1;       for (int i = 0; i < adj[v].size(); i++) {         int u = adj[v][i];         if (!mrk[u]) {           pair<long long, int> p1 = make_pair(dist[u], u);           s.erase(p1);           dist[u] = min(dist[u], w[v][i] + dist[v]);           s.insert(make_pair(dist[u], u));         }       }     }   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, cnt = 0;     long long mn = inf;     cin >> n;     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         long long k;         cin >> k;         w[i].push_back(k);         w[j].push_back(k);         adj[i].push_back(j);         adj[j].push_back(i);         cnt++;         mn = min(mn, k);       }     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < w[i].size(); j++) {         w[i][j] -= mn;       }     }     for (int i = 0; i < n; i++) {       long long ww = inf;       for (int j = 0; j < adj[i].size(); j++) {         ww = min(ww, w[i][j]);       }       dist[i] = 2 * ww;       s.insert(make_pair(dist[i], i));     }     dijkstra();     for (int i = 0; i < n; i++) {       cout << dist[i] + (n - 1) * mn << endl;     }   }   