getting run time error.I am getting output in my editor.I cant find the error

#include<stdio.h>
main(){
int t,b[100],v;
static int q;

scanf("%d",&t);
while(t--){
          int a[100],n,l,p=0,dif=0,max=0;
           scanf("%d",&n);
           l=n;
           for(p=0;p<n;p++) scanf("%d",&a[p]);
           while(n!=1){
               int i=0,j,k,p1=0,p2=0;
               j=l-n;
               k=j+1;
               for(;i<=j;i++)p1+=a[i];
              
                                    
               for(;k<l;k++)p2+=a[k];
                                      
               if(p2-p1>0 ) dif=p2-p1;
               else dif=p1-p2;
              
               if(max<dif) max=dif;
               n--;
              
                      }
	b[q]=max;
	q++;                          
           }

for(v=0;v<q;v++)printf("%d\n",b[v]);

       }

Reason for Runtime Error: Your arrays a[] and b[] can store only 100 elements. Check the problem constraints again.

//