Language: C

void Enqueue(P );
P Dequeus(void);
int main()
{

  int i,n,q,T=0;
  P y;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",y.s,&y.time);
    Enqueue(y);
  }


  while(n!=0){
    y=Dequeue();
    if(y.time>q){
      y.time=y.time-q;
      T+=q;
      Enqueue(y);
    } 
    else{
      T=T+y.time;
      printf("%s %d\n",y.s,T);
      n--;
    }
  }
  return 0;
}



void Enqueue(P Y){
  if(LEN==tail) tail=0;
  Q[tail]=Y;
  tail++;
}

P Dequeue(void){
  if(head==LEN) head=0;
  return Q[head++];
}

Compiler output:
main.c:1:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    1 | void Enqueue(P );
      | ^~~~
main.c:2:1: error: unknown type name 'P'
    2 | P Dequeus(void);
      | ^
main.c: In function 'main':
main.c:7:3: error: unknown type name 'P'
    7 |   P y;
      |   ^
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d%d",&n,&q);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void Enqueue(P );
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d%d",&n,&q);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:19: error: request for member 's' in something not a structure or union
   10 |     scanf("%s%d",y.s,&y.time);
      |                   ^
main.c:10:24: error: request for member 'time' in something not a structure or union
   10 |     scanf("%s%d",y.s,&y.time);
      |                        ^
main.c:16:7: error: implicit declaration of function 'Dequeue'; did you mean 'Dequeus'? [-Wimplicit-function-declaration]
   16 |     y=Dequeue();
      |       ^~~~~~~
      |       Dequeus
main.c:17:9: error: request for member 'time' in something not a structure or union
   17 |     if(y.time>q){
      |         ^
main.c:18:8: error: request for member 'time' in something not a structure or union
   18 |       y.time=y.time-q;
      |        ^
main.c:18:15: error: request for member 'time' in something not a structure or union
   18 |       y.time=y.time-q;
      |               ^
main.c:23:12: error: request for member 'time' in something not a structure or union
   23 |       T=T+y.time;
      |            ^
main.c:24:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 |       printf("%s %d\n",y.s,T);
      |       ^~~~~~
main.c:24:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:25: error: request for member 's' in something not a structure or union
   24 |       printf("%s %d\n",y.s,T);
      |                         ^
main.c: At top level:
main.c:33:14: error: unknown type name 'P'
   33 | void Enqueue(P Y){
      |              ^
main.c:39:1: error: unknown type name 'P'
   39 | P Dequeue(void){
      | ^
main.c: In function 'Dequeue':
main.c:40:6: error: 'head' undeclared (first use in this function)
   40 |   if(head==LEN) head=0;
      |      ^~~~
main.c:40:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:12: error: 'LEN' undeclared (first use in this function)
   40 |   if(head==LEN) head=0;
      |            ^~~
main.c:41:10: error: 'Q' undeclared (first use in this function)
   41 |   return Q[head++];
      |          ^