Language: C

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#define N 10000

struct Queue {
	char name[100];
	int time;
};

int head, tail, n;
Queue Q[N];

void initialize();
void enqueue(Queue);
struct Queue dequeue();

int main() {
	Queue a;
	int q, i, t=0, cnt = 0;
	scanf("%d%d", &n, &q);
	initialize();
	for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
	while (cnt != n) {
		a = dequeue();
		if (a.time <= q) {
			t += a.time;
			printf("%s %d\n", a.name, t);
			++cnt;
		}
		else {
			t += q;
			a.time -= q;
			enqueue(a);
		}
	}
	return 0;
}

void initialize() {
	head = tail = 0;
}

void enqueue(Queue a) {
	Q[tail] = a;
	if (tail + 1 == n) tail = 0;
	else ++tail;
}

Queue dequeue() {
	Queue a;
	a = Q[head];
	if (head + 1 == n) head = 0;
	else ++head;
	return a;
}

Compiler output:
main.c:12:1: error: unknown type name 'Queue'; use 'struct' keyword to refer to the type
   12 | Queue Q[N];
      | ^~~~~
      | struct 
main.c:15:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   15 | void enqueue(Queue);
      | ^~~~
main.c: In function 'main':
main.c:19:9: error: unknown type name 'Queue'; use 'struct' keyword to refer to the type
   19 |         Queue a;
      |         ^~~~~
      |         struct 
main.c:23:52: error: request for member 'name' in something not a structure or union
   23 |         for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
      |                                                    ^
main.c:23:64: error: request for member 'time' in something not a structure or union
   23 |         for (i = 0; i < n; i++) scanf("%s %d", Q[i].name, &Q[i].time);
      |                                                                ^
main.c:25:21: error: incompatible types when assigning to type 'int' from type 'struct Queue'
   25 |                 a = dequeue();
      |                     ^~~~~~~
main.c:26:22: error: request for member 'time' in something not a structure or union
   26 |                 if (a.time <= q) {
      |                      ^
main.c:27:31: error: request for member 'time' in something not a structure or union
   27 |                         t += a.time;
      |                               ^
main.c:28:44: error: request for member 'name' in something not a structure or union
   28 |                         printf("%s %d\n", a.name, t);
      |                                            ^
main.c:33:26: error: request for member 'time' in something not a structure or union
   33 |                         a.time -= q;
      |                          ^
main.c: At top level:
main.c:44:14: error: unknown type name 'Queue'
   44 | void enqueue(Queue a) {
      |              ^~~~~
main.c:50:1: error: unknown type name 'Queue'; use 'struct' keyword to refer to the type
   50 | Queue dequeue() {
      | ^~~~~
      | struct 
main.c:50:7: error: conflicting types for 'dequeue'; have 'int()'
   50 | Queue dequeue() {
      |       ^~~~~~~
main.c:16:14: note: previous declaration of 'dequeue' with type 'struct Queue()'
   16 | struct Queue dequeue();
      |              ^~~~~~~
main.c: In function 'dequeue':
main.c:51:9: error: unknown type name 'Queue'; use 'struct' keyword to refer to the type
   51 |         Queue a;
      |         ^~~~~
      |         struct