Language: C

dio.h>
#define MAX 100000
struct queue {
	char name[11];
	int time;
};

int head;
int tail;

struct queue dequeue(struct queue p[])
{	
	int i;
	struct queue tmp = p[head];
	head = (head + 1) % (MAX + 1);
	return tmp;
}

void enqueue(struct queue p[], struct queue tmp, int tail)
{	
	p[tail] = tmp;
}

int main()
{	
	int i, idx;
	int n, q;
	int rem, timer;
	struct queue p[MAX];

	scanf("%d %d", &n, &q);

	struct queue ret[n];

	for(i = 0; i < n; i++)
		scanf("%s %d", p[i].name, &p[i].time);
	head = 0;
	tail = n - 1;
	rem = n;
	timer = 0;
	idx = 0;
	
	while(timer <= 1000000 && rem > 0) {
		struct queue tmp;
		if(p[head].time <= q) {
			timer += p[head].time;
			tmp = dequeue(p);
			tmp.time = timer;
			enqueue(ret, tmp, idx);
			idx++;
			rem--;
		}
		else {
			timer += q;
			p[head].time -= q;
			tail = (tail + 1) % (MAX + 1);
			tmp = dequeue(p);
			enqueue(p, tmp, tail);
		}
	}

	for(i = 0; i < n; i++)
		printf("%s %d\n", ret[i].name, ret[i].time);

    return 0;
}

Compiler output:
main.c:1:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | dio.h>
      |    ^
main.c:11:35: error: array type has incomplete element type 'struct queue'
   11 | struct queue dequeue(struct queue p[])
      |                                   ^
main.c:11:14: error: return type is an incomplete type
   11 | struct queue dequeue(struct queue p[])
      |              ^~~~~~~
main.c: In function 'dequeue':
main.c:14:16: error: variable 'tmp' has initializer but incomplete type
   14 |         struct queue tmp = p[head];
      |                ^~~~~
main.c:14:22: error: storage size of 'tmp' isn't known
   14 |         struct queue tmp = p[head];
      |                      ^~~
main.c:16:16: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   16 |         return tmp;
      |                ^~~
main.c:11:14: note: declared here
   11 | struct queue dequeue(struct queue p[])
      |              ^~~~~~~
main.c: At top level:
main.c:19:27: error: array type has incomplete element type 'struct queue'
   19 | void enqueue(struct queue p[], struct queue tmp, int tail)
      |                           ^
main.c:19:45: error: parameter 2 ('tmp') has incomplete type
   19 | void enqueue(struct queue p[], struct queue tmp, int tail)
      |                                ~~~~~~~~~~~~~^~~
main.c: In function 'main':
main.c:29:22: error: array type has incomplete element type 'struct queue'
   29 |         struct queue p[MAX];
      |                      ^
main.c:31:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   31 |         scanf("%d %d", &n, &q);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | dio.h>
main.c:31:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   31 |         scanf("%d %d", &n, &q);
      |         ^~~~~
main.c:31:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:33:22: error: array type has incomplete element type 'struct queue'
   33 |         struct queue ret[n];
      |                      ^~~
main.c:44:30: error: storage size of 'tmp' isn't known
   44 |                 struct queue tmp;
      |                              ^~~
main.c:47:39: error: type of formal parameter 1 is incomplete
   47 |                         tmp = dequeue(p);
      |                                       ^
main.c:57:39: error: type of formal parameter 1 is incomplete
   57 |                         tmp = dequeue(p);
      |                                       ^
main.c:63:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   63 |                 printf("%s %d\n", ret[i].name, ret[i].time);
      |                 ^~~~~~
main.c:63:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:63:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:63:17: note: include '<stdio.h>' or provide a declaration of 'printf'