Language: C

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  Q[tail]=x;
  if(tail+1==100000){
    tail=0;
  }
  else tail++;
}

P dequeue(){
  P x;
  x=Q[head];
  if(head+1==100000){
    head=0;
  }
  else head++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
    enqueue(Q[i]);
  }
 printf("\n");
while(head!=tail){
    u=dequeue();
 
    if(u.t>q){
      elaps=elaps+q;
      u.t=u.t-q;
      enqueue(u);
    }
    else {
      elaps=elaps+u.t;
      u.t=elaps;
    
      printf("%s %d\n",u.name,u.t);
       
    }
  }
  
  return 0;
}

Compiler output:
main.c:1:1: error: unknown type name 'P'
    1 | P Q[LEN+1];
      | ^
main.c:1:5: error: 'LEN' undeclared here (not in a function)
    1 | P Q[LEN+1];
      |     ^~~
main.c:4:14: error: unknown type name 'P'
    4 | void enqueue(P x){
      |              ^
main.c:12:1: error: unknown type name 'P'
   12 | P dequeue(){
      | ^
main.c: In function 'dequeue':
main.c:13:3: error: unknown type name 'P'
   13 |   P x;
      |   ^
main.c: In function 'main':
main.c:26:3: error: unknown type name 'P'
   26 |   P u;
      |   ^
main.c:27:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   27 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | P Q[LEN+1];
main.c:27:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   27 |   scanf("%d %d", &n, &q);
      |   ^~~~~
main.c:27:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:32:5: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   32 |     enqueue(Q[i]);
      |     ^~~~~~~
      |     dequeue
main.c:34:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |  printf("\n");
      |  ^~~~~~
main.c:34:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:34:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:38:9: error: request for member 't' in something not a structure or union
   38 |     if(u.t>q){
      |         ^
main.c:40:8: error: request for member 't' in something not a structure or union
   40 |       u.t=u.t-q;
      |        ^
main.c:40:12: error: request for member 't' in something not a structure or union
   40 |       u.t=u.t-q;
      |            ^
main.c:44:20: error: request for member 't' in something not a structure or union
   44 |       elaps=elaps+u.t;
      |                    ^
main.c:45:8: error: request for member 't' in something not a structure or union
   45 |       u.t=elaps;
      |        ^
main.c:47:25: error: request for member 'name' in something not a structure or union
   47 |       printf("%s %d\n",u.name,u.t);
      |                         ^
main.c:47:32: error: request for member 't' in something not a structure or union
   47 |       printf("%s %d\n",u.name,u.t);
      |                                ^