func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   const long long INF = 1e18;   struct P {     int id;     long long dis;     friend bool operator<(P a, P b) { return a.dis > b.dis; }   };   int n, m, q, x[N], y[N], t[N], l[2][N], id[N], c;   long long d[2][N], ans[N], pre[N];   vector<long long> add[N], del[N];   vector<int> g[N];   void dij(int p, int s) {     memset(d[p], 0x3f, sizeof(d[p])), d[p][s] = 0;     if (p) memset(pre, 0, sizeof(pre));     priority_queue<P> q;     q.push((P){s, 0ll});     while (!q.empty()) {       int u = q.top().id;       long long nd = q.top().dis;       q.pop();       if (nd != d[p][u]) continue;       for (auto e : g[u]) {         int v = x[e] + y[e] - u;         long long w = t[e];         if (d[p][u] + w < d[p][v])           q.push((P){v, d[p][v] = d[p][u] + w}), pre[v] = e;       }     }   }   void it(int p, int s) {     priority_queue<P> q;     for (int i = 1; i <= n; i++)       if (l[p][i] || i == 1) q.push((P){i, l[p][i]});     while (!q.empty()) {       int u = q.top().id;       q.pop();       for (auto e : g[u])         if (!id[e]) {           int v = x[e] + y[e] - u;           long long w = t[e];           if (d[p][u] + w == d[p][v] && l[p][u] < l[p][v])             q.push((P){v, l[p][v] = l[p][u]});         }     }   }   void solve(int i) {     if (l[0][x[i]] >= l[1][y[i]]) return;     long long val = d[0][x[i]] + t[i] + d[1][y[i]];     add[l[0][x[i]]].push_back(val), del[l[1][y[i]]].push_back(val);   }   int main() {     scanf( %d%d%d , &n, &m, &q);     for (int i = 1; i <= m; i++) {       scanf( %d%d%d , &x[i], &y[i], &t[i]);       g[x[i]].push_back(i), g[y[i]].push_back(i);     }     dij(0, 1), dij(1, n), memset(l[0], 0x3f, sizeof(l[0]));     for (int u = 1; u != n;) {       int e = pre[u], v = x[e] + y[e] - u;       u = v, l[0][u] = l[1][u] = id[e] = ++c, l[1][u] = -l[1][u];     }     l[0][1] = 0, it(0, 1), it(1, n);     for (int i = 1; i <= n; i++) l[1][i] = -l[1][i];     for (int i = 1; i <= m; i++)       if (!id[i]) solve(i), swap(x[i], y[i]), solve(i);     multiset<long long> s;     s.insert(INF);     for (int i = 0; i < c; i++) {       for (auto v : add[i]) s.insert(v);       for (auto v : del[i]) s.erase(v);       ans[i + 1] = *s.begin();     }     while (q--) {       int e;       long long len;       scanf( %d%lld , &e, &len);       long long res = len + min(d[0][x[e]] + d[1][y[e]], d[0][y[e]] + d[1][x[e]]);       if (len <= t[e] || !id[e])         res = min(res, d[0][n]);       else if (id[e])         res = min(res, ans[id[e]]);       printf( %lld n , res);     }     return 0;   }   