Language: C++

/*
https://t.me/unstoppabIesoIvemachinechannel
*/
#pragma ARCENIY_KIRILLOV_POVELITEL_KROKODILOV
//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC push_options
#pragma GCC optimize ("unroll-loops")
//#pragma GCC pop_options
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i > -1; i--)
#define rer(i, x, n) for (int i = x; i < n; i++)
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;











const int maxn = 303;
const int INF = 1e18;
int ce[maxn][maxn];
pair<int,int> d[maxn][maxn];
int coun(int i, int k, int j){
    int f = d[i][k].se;
    if (f >= ce[k][j]) return d[i][j].se - ce[k][j];
    else return d[k][j].se;
}
signed main(){
    fast;
    int n, m, L;
    for (int i = 0; i < maxn; i++){
        for (int j =0 ; j < maxn; j++){
            d[i][j] = {INF, -INF};
            ce[i][j] = INF;
        }
    }
    cin >> n >> m >> L;
    for (int i = 0 ; i < m; i++){
        int a, b, c;
        cin >> a >> b >> c;
        if (c > L) continue;
        a--, b--;
        ce[a][b] = c;
        ce[b][a] = c;
        d[a][b] = {0, L - c};
        d[b][a] = {0, L - c};
    }
    for (int flex = 0; flex flex <= n; flex++){
    for (int k=0; k<n; ++k)
        for (int i=0; i<n; ++i)
            for (int j=0; j<n; ++j){
                if ( (d[i][j].fi > d[i][k].fi + d[k][j].fi + (ce[k][j] > d[i][k].se) )  || ( (d[i][j].fi == (d[i][k].fi + d[k][j].fi + (ce[k][j] > d[i][k].se)) ) && (d[i][j].se < coun(i, k, j)) ) ||
                     (( (d[i][j].fi == (d[i][k].fi + d[k][j].fi + (ce[k][j] > d[i][k].se)) ) && (d[i][j].se == coun(i, k, j)) && ce[i][j] > ce[i][k] + ce[k][j] ))){
                    d[i][j].fi = d[i][k].fi + d[k][j].fi + (ce[k][j] > d[i][k].se) ;
                    d[i][j].se = coun(i, k, j);
                    ce[i][j] = ce[i][k] + ce[k][j];
                }
            }
    }
//    for (int i = 0; i < n; i++){
  //      for (int j = 0; j < n; j++){
  //          cout << i << ' ' << j <<  ' ' << d[i][j].fi << ' ' << d[i][j].se << endl;
  //      }
  //  }
    int q;
    cin >> q;
    for (int i = 0; i < q; i++){
        int s, t;
        cin >> s >> t;
        s--, t--;
        int ans = d[s][t].fi;
        if (ans >= n) cout << -1 << endl;
        else cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:28: error: expected ';' before 'flex'
   72 |     for (int flex = 0; flex flex <= n; flex++){
      |                            ^~~~~
      |                            ;
a.cc:72:38: error: expected ')' before ';' token
   72 |     for (int flex = 0; flex flex <= n; flex++){
      |         ~                            ^
      |                                      )
a.cc:72:40: error: 'flex' was not declared in this scope
   72 |     for (int flex = 0; flex flex <= n; flex++){
      |                                        ^~~~