Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <ctime>
#include <string>
#include <queue>

using namespace std;

int n, q, t;

int main(void){
	queue<pair<string, int>> Q;
	cin >> n >> q;
	for(int i = 0; i< n; i++){
		string s;
		int T;
		cin >> s >>T;
		Q.push((s, T));
	}

	while(!Q.empty()){
		pair<string, int> p;
		p = Q.front();
		Q.pop();
		if(p.second <= q){
			t += p.second;
			cout << p.first << " " << t << endl;
		}else{
			t += q;
			Q.push(p.first, p.second - q);
		}
	}
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: no matching function for call to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::push(int&)'
   22 |                 Q.push((s, T));
      |                 ~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:9:
/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<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, 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 'int' to 'const std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&' {aka 'const std::pair<std::__cxx11::basic_string<char>, 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<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'int' to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&&' {aka 'std::pair<std::__cxx11::basic_string<char>, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:34:31: error: no matching function for call to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::push(std::__cxx11::basic_string<char>&, int)'
   34 |                         Q.push(p.first, p.second - q);
      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/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<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note:   candidate expects 1 argument, 2 provided