Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;

bool isPossible(vector<pair<long int,long int>> &v,long int bombs, long int n,long int d, long int a){
		priority_queue<pair<long int,long int>,vector<pair<long int,long int>>,greater<pair<long int,long int>>> pq;
	for(auto ele : v)
		pq.push(ele);

	long int count = 0, start = -1;
	while(pq.size()){
		auto ele = pq.front();
		start = ele.first;
		queue<pair<long int,long int>> pq2;
		long int minHealthMonster = 1e18;
		long int idxMinHealth = 0;
		long int maxHealthMonster = 0, cur = 0;
		while(pq.size() && start + 2*d >= pq.front().first){
			auto ele = pq.front();
			pq.pop();
			cur = max(cur,ele.second);
			if(minHealthMonster > ele.second){
				idxMinHealth = ele.first;
				minHealthMonster = ele.second;
				maxHealthMonster = cur;
			}
			pq2.push(ele);
		}
		long int numAttacks = maxHealthMonster / a;
		count += numAttacks;
		long int totalDamage =numAttacks * a;
		while(pq2.size()){
			auto ele = pq2.front();
			pq2.pop();
			ele.second -= totalDamage;
			if(ele.second > 0)
				pq.push(ele);
		}
	}
	return count <= bombs;
}

int main(){
   IOS;
 //    #ifndef ONLINE_JUDGE
 //        freopen("in.txt",  "r",  stdin);
 //        freopen("out.txt", "w", stdout);
 //    #endif
   
   	long int n,d,a;
   	cin>>n>>d>>a;

   	vector<pair<long int,long int>> v(n);
   	for(long int i = 0; i < n; i++)
   		cin>>v[i].first>>v[i].second;

   	sort(v.begin(),v.end());

   	long int be = 0, en = 1e15, ans;

   	while(be <= en){
   		long int mid = (be + en) / 2;
   		if(isPossible(v,mid,n,d,a)){
   			ans = mid;
   			en = mid - 1;
   		}
   		else
   			be = mid + 1;
   	}
   	cout<<ans;
   return 0;
}

Compiler output:
a.cc: In function 'bool isPossible(std::vector<std::pair<long long int, long long int> >&, long long int, long long int, long long int, long long int)':
a.cc:42:31: error: 'class std::priority_queue<std::pair<long long int, long long int>, std::vector<std::pair<long long int, long long int> >, std::greater<std::pair<long long int, long long int> > >' has no member named 'front'
   42 |                 auto ele = pq.front();
      |                               ^~~~~
a.cc:48:54: error: 'class std::priority_queue<std::pair<long long int, long long int>, std::vector<std::pair<long long int, long long int> >, std::greater<std::pair<long long int, long long int> > >' has no member named 'front'
   48 |                 while(pq.size() && start + 2*d >= pq.front().first){
      |                                                      ^~~~~
a.cc:49:39: error: 'class std::priority_queue<std::pair<long long int, long long int>, std::vector<std::pair<long long int, long long int> >, std::greater<std::pair<long long int, long long int> > >' has no member named 'front'
   49 |                         auto ele = pq.front();
      |                                       ^~~~~