Language: C++

#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

constexpr ll MOD = 1000000007;
constexpr int INF = 0x3f3f3f3f;
constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

struct Edge {
  int to;
  ll coin, cost;
  Edge(int to, ll coin, ll cost) : to(to), coin(coin), cost(cost) {}
};

int main() {
  ll n, m, s;
  cin >> n >> m >> s;
  vector<vector<Edge>> g(n);
  vector<pair<ll, ll>> cd(n);
  ll a, b, c, d;
  rep(i, 0, m) {
    cin >> a >> b >> c >> d;
    --a, --b;
    g[a].emplace_back(b, c, d);
    g[b].emplace_back(a, c, d);
  }
  rep(i, 0, n) cin >> cd[i].first >> cd[i].second;

  using tup = tuple<ll, ll, int>;
  vector<vector<ll>> dp(n, vector<ll>(2525, INFL));
  s = min(s, 2500ll);
  dp[0][s] = 0;
  priority_queue<tup, vector<tup>, greater<tup>> pq;
  pq.emplace(0, s, 0);

  vector<ll> ans(n, INFL);
  // もつお金の上限 - aの上限50, nの上限50から50 * 50 程度持っていれば十分
  ll cost, coin;
  int now;
  while (pq.size()) {
    tie(cost, coin, now) = pq.top();
    pq.pop();
    if (cost > dp[now][coin]) continue;

    for (Edge e : g[now]) {
      if (coin >= e.coin && dp[e.to][coin - e.coin] > dp[now][coin] + e.cost) {
        dp[e.to][coin - e.coin] = dp[now][coin] + e.cost;
        pq.emplace(dp[e.to][coin - e.coin], coin - e.coin, e.to);
      }
    }
    if (coin + cd[now].first < 2500 &&
        dp[now][coin + cd[now].first] > dp[now][coin] + cd[now].second) {
      dp[now][coin + cd[now].first] = dp[now][coin] + cd[now].second;
      pq.emplace(dp[now][coin + cd[now].first], coin + cd[now].first, now);
    }
  }

  rep(i, 1, n) { cout << *min_element(dp[i].begin(), dp[i].end()) << '\n'; }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:10: error: no matching function for call to 'min(ll&, long long int)'
   43 |   s = min(s, 2500ll);
      |       ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:43:10: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   43 |   s = min(s, 2500ll);
      |       ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:43:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   43 |   s = min(s, 2500ll);
      |       ~~~^~~~~~~~~~~