Language: C++

#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

using P = pair<ll, ll>;
using data = pair<ll, P>;

struct edge {
    ll to, cost, time;
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m, s;
    cin >> n >> m >> s;
    chmin(s, 2500LL);
    vector<vector<edge>> g(n);
    for(ll i = 0; i < m; i++) {
        ll u, v, a, b;
        cin >> u >> v >> a >> b;
        g[--u].emplace_back(edge{--v, a, b});
        g[v].emplace_back(edge{u, a, b});
    }
    for(ll i = 0; i < n; i++) {
        ll c, d;
        cin >> c >> d;
        g[i].emplace_back(edge{i, -c, d});
    }
    vector<vector<ll>> dp(n, vector<ll>(2525, LLINF));
    dp[0][s] = 0;
    priority_queue<data, vector<data>, greater<data>> que;
    que.push(data(0, P(s, 0)));
    while(que.size()) {
        auto now = que.top();
        que.pop();
        ll nd = now.first;
        ll nm = now.second.first;
        ll nv = now.second.second;
        if(nd > dp[nv][nm]) {
            continue;
        }
        for(const auto &e : g[nv]) {
            if(nm - e.cost >= 0) {
                ll t = min(2500LL, nm - e.cost);
                if(dp[e.to][t] > nd + e.time) {
                    dp[e.to][t] = nd + e.time;
                    que.push(data(dp[e.to][t], P(t, e.to)));
                }
            }
        }
    }
    for(ll i = 1; i < n; i++) {
        ll ans = LLINF;
        for(int j = 0; j <= 2500; j++) {
            chmin(ans, dp[i][j]);
        }
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:37: error: template argument 1 is invalid
   59 |     priority_queue<data, vector<data>, greater<data>> que;
      |                                     ^
a.cc:59:37: error: template argument 2 is invalid
a.cc:59:48: error: template argument 1 is invalid
   59 |     priority_queue<data, vector<data>, greater<data>> que;
      |                                                ^~~~
a.cc:59:52: error: template argument 1 is invalid
   59 |     priority_queue<data, vector<data>, greater<data>> que;
      |                                                    ^~
a.cc:59:52: error: template argument 2 is invalid
a.cc:59:52: error: template argument 3 is invalid
a.cc:60:9: error: request for member 'push' in 'que', which is of non-class type 'int'
   60 |     que.push(data(0, P(s, 0)));
      |         ^~~~
a.cc:60:14: error: reference to 'data' is ambiguous
   60 |     que.push(data(0, P(s, 0)));
      |              ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:33:7: note:                 'using data = struct std::pair<long long int, std::pair<long long int, long long int> >'
   33 | using data = pair<ll, P>;
      |       ^~~~
a.cc:61:15: error: request for member 'size' in 'que', which is of non-class type 'int'
   61 |     while(que.size()) {
      |               ^~~~
a.cc:62:24: error: request for member 'top' in 'que', which is of non-class type 'int'
   62 |         auto now = que.top();
      |                        ^~~
a.cc:63:13: error: request for member 'pop' in 'que', which is of non-class type 'int'
   63 |         que.pop();
      |             ^~~
a.cc:75:25: error: request for member 'push' in 'que', which is of non-class type 'int'
   75 |                     que.push(data(dp[e.to][t], P(t, e.to)));
      |                         ^~~~
a.cc:75:30: error: reference to 'data' is ambiguous
   75 |                     que.push(data(dp[e.to][t], P(t, e.to)));
      |                              ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:33:7: note:                 'using data = struct std::pair<long long int, std::pair<long long int, long long int> >'
   33 | using data = pair<ll, P>;
      |       ^~~~