Facing difficulty. answer not getting right

#include
#include
#include<stdlib.h>
using namespace std;
#define ll long long
ll a[1000005],prefixsum[1000005];
//using namespace std;
int main() {
//ll a[1000005],prefixsum[1000005];
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
ll sum=0;
memset(prefixsum,0,sizeof prefixsum);
prefixsum[0]=1;
for(int i=0;i<n;i++){
cin>>a[i];
sum += a[i];
sum %=n;
sum = (sum+n)%n;
prefixsum[sum]++;
}
ll ans=0;
for(int i=0;i<n;i++){
//cout<<prefixsum[i]<<" ";
ll no=prefixsum[i];
ans += ((no)*(no-1))/2;
}
cout<<ans<<endl;
}

return 0;

}

@himanshug04 Please save the code on coding blocks ide and share its link.

at coding blocks ide there is no option for copying this code and to paste it there.so I cant able to use it

@himanshug04 Copy your code, Go to ide.codingblocks.com , paste it there, save it and then share its link. It is easy for us to debug your code then.

@pratyush63 I wrote this long code. and there no option to paste it. please sir tell me how I can paste a code there. It will help me.

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.