Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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);
  }

  while(elaps !=n){
    u = dequeue();
    if(u.t-q <= 0){
      c += u.t;
      u.t = 0;
      elaps++;
      printf("%s %d\n",u.name,c);
    }
    else if(u.t > 0){
      c += q;
      u.t -+ q;
      enqueue(u);
    }
  }
  return 0;
}
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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);
  }

  while(elaps !=n){
    u = dequeue();
    if(u.t-q <= 0){
      c += u.t;
      u.t = 0;
      elaps++;
      printf("%s %d\n",u.name,c);
    }
    else if(u.t > 0){
      c += q;
      u.t -+ q;
      enqueue(u);
    }
  }
  return 0;
}
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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);
  }

  while(elaps !=n){
    u = dequeue();
    if(u.t-q <= 0){
      c += u.t;
      u.t = 0;
      elaps++;
      printf("%s %d\n",u.name,c);
    }
    else if(u.t > 0){
      c += q;
      u.t -+ q;
      enqueue(u);
    }
  }
  return 0;
}
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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);
  }

  while(elaps !=n){
    u = dequeue();
    if(u.t-q <= 0){
      c += u.t;
      u.t = 0;
      elaps++;
      printf("%s %d\n",u.name,c);
    }
    else if(u.t > 0){
      c += q;
      u.t -+ q;
      enqueue(u);
    }
  }
  return 0;
}

Compiler output:
main.c:59:16: error: redefinition of 'struct pp'
   59 | typedef struct pp{
      |                ^~
main.c:5:16: note: originally defined here
    5 | typedef struct pp{
      |                ^~
main.c:62:2: error: conflicting types for 'P'; have 'struct pp'
   62 | }P;
      |  ^
main.c:8:2: note: previous declaration of 'P' with type 'P' {aka 'struct pp'}
    8 | }P;
      |  ^
main.c:64:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   64 | void enqueue(P);
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:65:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   65 | P dequeue();
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:67:3: error: conflicting types for 'Q'; have 'P[100006]' {aka 'struct pp[100006]'}
   67 | P Q[LEN+1];
      |   ^
main.c:13:3: note: previous declaration of 'Q' with type 'P[100006]' {aka 'struct pp[100006]'}
   13 | P Q[LEN+1];
      |   ^
main.c:68:5: error: redefinition of 'head'
   68 | int head=0, tail=0, n;
      |     ^~~~
main.c:14:5: note: previous definition of 'head' with type 'int'
   14 | int head=0, tail=0, n;
      |     ^~~~
main.c:68:13: error: redefinition of 'tail'
   68 | int head=0, tail=0, n;
      |             ^~~~
main.c:14:13: note: previous definition of 'tail' with type 'int'
   14 | int head=0, tail=0, n;
      |             ^~~~
main.c:70:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   70 | void enqueue(P x){
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:76:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   76 | P dequeue(){
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:82:5: error: redefinition of 'main'
   82 | int main(){
      |     ^~~~
main.c:28:5: note: previous definition of 'main' with type 'int()'
   28 | int main(){
      |     ^~~~
main.c:113:16: error: redefinition of 'struct pp'
  113 | typedef struct pp{
      |                ^~
main.c:59:16: note: originally defined here
   59 | typedef struct pp{
      |                ^~
main.c:116:2: error: conflicting types for 'P'; have 'struct pp'
  116 | }P;
      |  ^
main.c:62:2: note: previous declaration of 'P' with type 'P' {aka 'struct pp'}
   62 | }P;
      |  ^
main.c:118:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
  118 | void enqueue(P);
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:119:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
  119 | P dequeue();
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:121:3: error: conflicting types for 'Q'; have 'P[100006]' {aka 'struct pp[100006]'}
  121 | P Q[LEN+1];
      |   ^
main.c:13:3: note: previous declaration of 'Q' with type 'P[100006]' {aka 'struct pp[100006]'}
   13 | P Q[LEN+1];
      |   ^
main.c:122:5: error: redefinition of 'head'
  122 | int head=0, tail=0, n;
      |     ^~~~
main.c:14:5: note: previous definition of 'head' with type 'int'
   14 | int head=0, tail=0, n;
      |     ^~~~
main.c:122:13: error: redefinition of 'tail'
  122 | int head=0, tail=0, n;
      |             ^~~~
main.c:14:13: note: previous definition of 'tail' with type 'int'
   14 | int head=0, tail=0, n;
      |             ^~~~
main.c:124:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
  124 | void enqueue(P x){
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:130:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
  130 | P dequeue(){
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:136:5: error: redefinition of 'main'
  136 | int main(){
      |     ^~~~
main.c:28:5: note: previous definition of 'main' with type 'int()'
   28 | int main(){
      |     ^~~~
main.c:167:16: error: redefinition of 'struct pp'
  167 | typedef struct pp{
      |                ^~
main.c:113:16: note: originally defined here
  113 | typedef struct pp{
      |                ^~
main.c:170:2: error: conflicting types for 'P'; have 'struct pp'
  170 | }P;
      |  ^
main.c:116:2: note: previous declaration of 'P' with type 'P' {aka 'struct pp'}
  116 | }P;
      |  ^
main.c:172:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
  172 | void enqueue(P);
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:173:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
  173 | P dequeue();
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:175:3: error: conflicting types for 'Q'; have 'P[100006]' {aka 'struct pp[100006]'}
  175 | P Q[LEN+1];
      |   ^
main.c:13:3: note: previous declaration of 'Q' with type 'P[100006]' {aka 'struct pp[100006]'}
   13 | P Q[LEN+1];
      |   ^
main.c:176:5: error: redefinition of 'head'
  176 | int head=0, tail=0, n;
      |     ^~~~
main.c:14:5: note: previous definition of 'head' with type 'int'
   14 | int head=0, tail=0, n;
      |     ^~~~
main.c:176:13: error: redefinition of 'tail'
  176 | int head=0, tail=0, n;
      |             ^~~~
main.c:14:13: note: previous definition of 'tail' with type 'int'
   14 | int head=0, tail=0, n;
      |             ^~~~
main.c:178:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
  178 | void enqueue(P x){
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:184:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
  184 | P dequeue(){
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:190:5: error: redefinition of 'main'
  190 | int main(){
      |     ^~~~
main.c:28:5: note: previous definition of 'main' with type 'int()'
   28 | int main(){
      |     ^~~~