Language: C++

N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      | ^
a.cc:1:25: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                         ^~~~
a.cc: In function 'int main()':
a.cc:1:54: error: 'N' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                      ^
a.cc:1:57: error: 'T' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                         ^
a.cc:1:60: error: 'L' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                            ^
a.cc:1:36: error: 'scanf' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                    ^~~~~
a.cc:1:66: error: 'i' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                  ^
a.cc:1:86: error: 'm' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                      ^
a.cc:1:90: error: 'n' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                          ^
a.cc:1:99: error: 'i' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                   ^
a.cc:1:103: error: 'm' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                       ^
a.cc:1:110: error: 'n' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                              ^
a.cc:1:118: error: 'N' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                      ^
a.cc:1:137: error: 'T' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                         ^
a.cc:1:141: error: 'r' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                             ^
a.cc:1:158: error: 'r' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                              ^
a.cc:1:168: error: 'T' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                        ^
a.cc:1:170: error: 'L' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                          ^
a.cc:1:181: error: 'r' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                                     ^
a.cc:1:186: error: 'T' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                                          ^
a.cc:1:221: error: 'T' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                                                                             ^
a.cc:1:246: error: 'i' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                                                                                                      ^
a.cc:1:232: error: 'printf' was not declared in this scope
    1 | N,T,L,i,m[101],n[101],r;main(){for(scanf("%d%d%d%d",&N,&T,&L,&L);i++<N;)scanf("%d%d",m+i,n+i);for(i=0;m[++i]+n[i];i%=N){if(m[i]){m[i]--;T++;r++;}else{n[i]--;r+=10;}if(T>L)break;if(r>8){T-=(r+1)%10;m[i]+=(r+1)%10;r=0;}if(T<0)break;}printf("%d\n",i);}
      |                                                                                                                                                                                                                                        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '