Language: C++

#include<bits/stdc++.h>
using namespace std;using L=long long;using V=pair<L,L>;
#define F first
#define S second
#define I XH[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(){cin>>N>>D>>A;R 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;}}cout<<r;} 

Compiler output:
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){cin>>N>>D>>A;R 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;}}cout<<r;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:11: error: 'XH' was not declared in this scope; did you mean 'X'?
    5 | #define I XH[i]
      |           ^~
a.cc:8:28: note: in expansion of macro 'I'
    8 | main(){cin>>N>>D>>A;R 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;}}cout<<r;}
      |                            ^
a.cc:5:11: error: 'XH' was not declared in this scope; did you mean 'X'?
    5 | #define I XH[i]
      |           ^~
a.cc:8:80: note: in expansion of macro 'I'
    8 | main(){cin>>N>>D>>A;R 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;}}cout<<r;}
      |                                                                                ^
a.cc:5:11: error: 'XH' was not declared in this scope; did you mean 'X'?
    5 | #define I XH[i]
      |           ^~
a.cc:8:109: note: in expansion of macro 'I'
    8 | main(){cin>>N>>D>>A;R 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;}}cout<<r;}
      |                                                                                                             ^
a.cc:8:151: error: no matching function for call to 'std::queue<std::pair<long long int, long long int> >::push(<brace-enclosed initializer list>)'
    8 | main(){cin>>N>>D>>A;R 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;}}cout<<r;}
      |                                                                                                                                                 ~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Sequence = std::deque<std::pair<long long int, long long int>, std::allocator<std::pair<long long int, long long int> > >; value_type = std::pair<long long int, long long int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::queue<std::pair<long long int, long long int> >::value_type&' {aka 'const std::pair<long long int, long long int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Sequence = std::deque<std::pair<long long int, long long int>, std::allocator<std::pair<long long int, long long int> > >; value_type = std::pair<long long int, long long int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<long long int, long long int> >::value_type&&' {aka 'std::pair<long long int, long long int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~