Language: C++

#include<bits/stdc++.h>
using L=long long;using V=pair<L,L>;
#define F first
#define S second
#define I X[i]
#define R for(L i=0;i<N;i++)
L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;} 

Compiler output:
a.cc:2:27: error: 'pair' does not name a type
    2 | using L=long long;using V=pair<L,L>;
      |                           ^~~~
a.cc:7:19: error: 'V' does not name a type
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                   ^
a.cc:7:31: error: 'queue' does not name a type
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                               ^~~~~
a.cc:7:41: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                         ^~~~
a.cc: In function 'int main()':
a.cc:5:11: error: 'X' was not declared in this scope
    5 | #define I X[i]
      |           ^
a.cc:7:78: note: in expansion of macro 'I'
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                                                              ^
a.cc:7:92: error: 'X' was not declared in this scope
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                                                                            ^
a.cc:7:87: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                                                                       ^~~~
      |                                                                                       std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:7:108: error: 'P' was not declared in this scope
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                                                                                            ^
a.cc:7:195: error: 'P' was not declared in this scope
    7 | L N,D,A,n=0,r=0,t;V X[200005];queue<V>P;main(){std::cin>>N>>D>>A;R std::cin>>I.F>>I.S;sort(X,X+N);R{while(!P.empty()&P.front().F<I.F){n-=P.front().S;P.pop();}I.S-=n;if(I.S>0){t=(I.S+A-1)/A;r+=t;P.push({I.F+2*D,t*A});n+=t*A;}}std::cout<<r;}
      |                                                                                                                                                                                                   ^