Language: C++

#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define print(x) std::cout<<x<<"\n"
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
  for (auto i = first;i != last;i++){
    cin >> (*i);
  }
}
template<class itr> void array_output(itr start,itr goal){
  string ans = "",k = " ";
  for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
  if (!ans.empty()) ans.pop_back();
  PRINT(ans);
}
ll gcd(ll a, ll b) {
  return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 2510;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};

struct Node{
	ll to=0;
	ll cost=0;
};
class Dijkstra{
 private:

  vector<vector<Node>> G;
  VI d;
  ll siz;
 public:
  Dijkstra(ll n){
    G.resize(n);
    siz = n;
  }
  void add_edge(ll from,ll to,ll cost){
    G[from].push_back(Node{to,cost});
  }
  vector<ll> dijkstra(ll s){
    priority_queue<P,vector<P>,greater<P>> q;
    d.assign(siz,INF);
    d[s] = 0;
    q.push(P(0,s));
    while(!q.empty()){
      P p = q.top();q.pop();
      ll v = p.second;
      if (d[v] < p.first) continue;
      for(Node &e:G[v]){
        if (chmin(d[e.to],d[v]+e.cost)){
          q.push(P(d[e.to],e.to));
        }
      }
    }
    return d;
  }
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m,s;
  cin >> n >> m >> s;
  Dijkstra g(2501*n); // u:2500*u+money
  ll u,v,a,b,c,d;
  rep(i,m){
    cin >> u >> v >> a >> b;
    --u;
    --v;
    rep(i,a,2501){
      g.add_edge(2501*u+i,2501*v+i-a,b);
      g.add_edge(2501*v+i,2501*u+i-a,b);
    }
  }
  rep(i,n){
    cin >> c >> d;
    rep(j,2500){
      g.add_edge(2501*i+j,2501*i+min(j+c,(ll)2500),d);
    }
  }
  vector<ll> dist = g.dijkstra(min(s,(ll)2500));
  rep(i,1,n){
    ll ans = INF;
    rep(j,2501){
      chmin(ans,dist[2501*i+j]);
    }
    print(ans);
  }
}


Compiler output:
a.cc:25:10: error: 'vector' does not name a type
   25 | using VI=vector<ll>;
      |          ^~~~~~
a.cc:26:10: error: 'vector' does not name a type
   26 | using VD=vector<ld>;
      |          ^~~~~~
a.cc:27:11: error: 'vector' does not name a type
   27 | using VVI=vector<VI>;
      |           ^~~~~~
a.cc:28:10: error: 'vector' does not name a type
   28 | using VC=vector<char>;
      |          ^~~~~~
a.cc:29:11: error: 'vector' does not name a type
   29 | using VVC=vector<VC>;
      |           ^~~~~~
a.cc:30:10: error: 'vector' does not name a type
   30 | using VS=vector<string>;
      |          ^~~~~~
a.cc:31:12: error: 'pair' does not name a type
   31 | using PLL =pair<ll,ll>;
      |            ^~~~
a.cc:32:11: error: 'pair' does not name a type
   32 | using PLD=pair<ld,ld>;
      |           ^~~~
a.cc:33:12: error: 'vector' does not name a type
   33 | using VPLL=vector<PLL>;
      |            ^~~~~~
a.cc: In function 'void Yes(bool)':
a.cc:40:48: error: 'PRINT' was not declared in this scope
   40 | inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
      |                                                ^~~~~
a.cc:40:67: error: 'PRINT' was not declared in this scope
   40 | inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
      |                                                                   ^~~~~
a.cc: In function 'void array_output(itr, itr)':
a.cc:50:3: error: there are no arguments to 'PRINT' that depend on a template parameter, so a declaration of 'PRINT' must be available [-fpermissive]
   50 |   PRINT(ans);
      |   ^~~~~
a.cc:50:3: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
a.cc: At global scope:
a.cc:70:3: error: 'VI' does not name a type
   70 |   VI d;
      |   ^~
a.cc: In member function 'std::vector<long long int> Dijkstra::dijkstra(ll)':
a.cc:82:5: error: 'd' was not declared in this scope; did you mean 'ld'?
   82 |     d.assign(siz,INF);
      |     ^
      |     ld