#include using namespace std; using ll = long long; const ll INF = LLONG_MAX / 4; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N, M, C; cin >> N >> M >> C; vector>> g(N + 1); auto add_edge = [&](ll i, ll j, ll c) { g[i].emplace_back(j, c); g[j].emplace_back(i, c); }; ll ans = 0; for(ll i = 0; i < N; i++) { ll A; cin >> A; add_edge(i, i + 1, A); ans += A; } while(M--) { ll L, R; cin >> L >> R; add_edge(--L, R, C); } auto dijkstra = [&](ll s) -> vector { vector cost(N + 1, LLONG_MAX); priority_queue q(greater<>{}, vector>{}); auto push = [&](ll i, ll c) { if(cost[i] <= c) return; cost[i] = c; q.emplace(c, i); }; push(s, 0); while(q.size()) { auto [c, i] = q.top(); q.pop(); // if(cost[i] != c) continue; for(auto [j, d] : g[i]) push(j, c + d); } return cost; }; ans -= dijkstra(0)[N]; cout << ans << endl; }