Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define f first
#define s second
#define mp make_pair
#define sz size()
#define ll long long
long long d, uron, damage, ans;
int n;
struct monster {
	long long x = 0, h = 0;
	monster() {};
} a[(int)2e5+10];
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> d >> uron;
	for(int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].h;
	list <monster> q;
	for(int i = 1; i <= n; ++i) {
		while(!q.empty()) {
			damage -= q.front().h;
			q.pop_back();
		}
		long long hp = a[i].h - damage;
		long long t = max(hp / uron + (hp % uron != 0), 0ll);
		t = (hp < 0 ? 0 : t);
		damage += uron * t;
		q.emplace_back(a[i].x + 2 * d, uron * t);
		ans += t;
	}
	cout << ans;
	return 0;
}

Compiler output:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
                 from /usr/include/c++/14/bits/allocator.h:46,
                 from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/new_allocator.h: In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = monster; _Args = {long long int, long long int}; _Tp = std::_List_node<monster>]':
/usr/include/c++/14/bits/alloc_traits.h:575:17:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = monster; _Args = {long long int, long long int}; _Tp = std::_List_node<monster>; allocator_type = std::allocator<std::_List_node<monster> >]'
  575 |           __a.construct(__p, std::forward<_Args>(__args)...);
      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:714:33:   required from 'std::__cxx11::list<_Tp, _Alloc>::_Node* std::__cxx11::list<_Tp, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {long long int, long long int}; _Tp = monster; _Alloc = std::allocator<monster>; _Node = std::__cxx11::list<monster>::_Node]'
  714 |           _Node_alloc_traits::construct(__alloc, __p->_M_valptr(),
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
  715 |                                         std::forward<_Args>(__args)...);
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2013:32:   required from 'void std::__cxx11::list<_Tp, _Alloc>::_M_insert(iterator, _Args&& ...) [with _Args = {long long int, long long int}; _Tp = monster; _Alloc = std::allocator<monster>; iterator = std::__cxx11::list<monster>::iterator]'
 2013 |          _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
      |                         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1330:19:   required from 'std::__cxx11::list<_Tp, _Alloc>::reference std::__cxx11::list<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {long long int, long long int}; _Tp = monster; _Alloc = std::allocator<monster>; reference = monster&]'
 1330 |           this->_M_insert(end(), std::forward<_Args>(__args)...);
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:34:17:   required from here
   34 |                 q.emplace_back(a[i].x + 2 * d, uron * t);
      |                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:191:11: error: no matching function for call to 'monster::monster(long long int, long long int)'
  191 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:16:9: note: candidate: 'monster::monster()'
   16 |         monster() {};
      |         ^~~~~~~
a.cc:16:9: note:   candidate expects 0 arguments, 2 provided
a.cc:14:8: note: candidate: 'constexpr monster::monster(const monster&)'
   14 | struct monster {
      |        ^~~~~~~
a.cc:14:8: note:   candidate expects 1 argument, 2 provided
a.cc:14:8: note: candidate: 'constexpr monster::monster(monster&&)'
a.cc:14:8: note:   candidate expects 1 argument, 2 provided