Divisible sub arrays

#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
long long int n;
long long int a[10000005];

  while(t--)
  {
  //int n;
  cin>>n;
  //int a[n];
  for(int i=0;i<n;i++)
  cin>>a[i];
  long long int s=0,c=0;
  long long int prefixsum[10000005]={0};
  for(int i=0;i<n;i++)
  {
        s += a[i];
        s = s%n;
        s = (s+n)%n;
        prefixsum[s]++;
        //if(s==0)
        //{
          //    c++;
            //  s=0;
        //}
  }
  long long int ans=(prefixsum[0]*(prefixsum[0]+1))/2;
  for(long long int i=1;i<n;i++)

{
ans=ans+(prefixsum[i]*(prefixsum[i]-1))/2;
}
cout<<ans;
cout<<endl;
}
}
i am getting run time error

now your code works fine https://ide.codingblocks.com/s/313569

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.