func_code_string: #include <bits/stdc++.h>   using namespace std;   int dist[65][65][65];   int dp[65][65][65][2];   int n, m, r, td[65][65];   vector<long long> li[1024];   int ans[222222];   void prep() {     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++)         for (int k = 0; k < m; k++) dp[i][j][k][0] = dist[k][i][j];     for (int i = 0; i < int(li[0].size()); i++) {       int u = li[0][i], v = li[0][i + 1], ii = li[0][i + 2];       i++;       i++;       ans[ii] = 2000000000;       for (int car = 0; car < m; car++) ans[ii] = min(ans[ii], dp[u][v][car][0]);     }     int flag = 1;     for (int k = 1; k <= n; k++) {       for (int i = 0; i < n; i++)         for (int j = 0; j < n; j++) {           td[i][j] = dp[i][j][0][1 - flag];           for (int cc = 0; cc < m; cc++) {             td[i][j] = min(dp[i][j][cc][1 - flag], td[i][j]);           }         }       for (int car = 0; car < m; car++) {         for (int i = 0; i < n; i++)           for (int j = 0; j < n; j++) {             dp[i][j][car][flag] = td[i][j];             for (int p = 0; p < n; p++)               dp[i][j][car][flag] =                   min(dp[i][j][car][flag], td[i][p] + dist[car][p][j]);           }       }       for (int i = 0; i < int(li[k].size()); i++) {         int u = li[k][i], v = li[k][i + 1], ii = li[k][i + 2];         i++;         i++;         ans[ii] = 2000000000;         for (int car = 0; car < m; car++)           ans[ii] = min(ans[ii], dp[u][v][car][flag]);       }       flag = 1 - flag;     }   }   int main() {     scanf( %d , &n);     scanf( %d , &m);     scanf( %d , &r);     for (int i = 0; i < m; i++) {       for (int j = 0; j < n; j++)         for (int k = 0; k < n; k++) scanf( %d , &dist[i][j][k]);       for (int k = 0; k < n; k++)         for (int ii = 0; ii < n; ii++)           for (int j = 0; j < n; j++)             dist[i][ii][j] = min(dist[i][ii][j], dist[i][ii][k] + dist[i][k][j]);     }     for (int i = 0; i < r; i++) {       int u, v, k;       scanf( %d , &u);       scanf( %d , &v);       scanf( %d , &k);       u--;       v--;       k = min(k, n);       li[k].push_back(u);       li[k].push_back(v);       li[k].push_back(i);     }     prep();     for (int i = 0; i < r; i++) {       printf( %d , ans[i]);       ;       printf(  n );     }   }   