#include #include #include using namespace std; int N,M,C; int A[2<<17]; vector >G[2<<17]; long dp[2<<17]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>M>>C; long sum=0; for(int i=0;i>A[i]; G[i].push_back(make_pair(i+1,A[i])); G[i+1].push_back(make_pair(i,A[i])); sum+=A[i]; } for(int i=0;i>l>>r; G[l-1].push_back(make_pair(r,C)); } for(int i=1;i<=N;i++)dp[i]=9e18; priority_queue >Q; Q.push(make_pair(0L,0)); while(!Q.empty()) { int u=Q.top().second; long c=-Q.top().first; Q.pop(); if(dp[u]e:G[u]) { int v=e.first; long nc=c+e.second; if(dp[v]>nc) { dp[v]=nc; Q.push(make_pair(-nc,v)); } } } cout<