Calculate the sum

sir in this question my test case 2 is coming out to be wrong kindly check it

#include

using namespace std;
int main(){
int N,i,j;
char ch;
long long int A[100000],B[100000];
cin>>N;
if(N>=1 && N<=100000){
for(i=0;i<N;i++){
cin>>A[i];
if(ch==cin.get()){
break;
}
if(A[i]<=0){
return 0;
}
}
int Q,X;
cin>>Q;
if(Q>=0 && Q<=1000000){
for(j=1;j<=Q;j++){
cin>>X;
if(X>=0 && X<N){
for(i=0;i<N;i++){
if(i-X<0){
B[i]=A[i]+A[N-X];
;
}
else if(i-X>=0){
B[i]=A[i]+A[i-X];
}
}

        }
        for(i=0;i<N;i++){
            A[i]=B[i];
            
    }
}

int sum=0;
for(i=0;i<N;i++){
    sum+=A[i];

}
cout<<sum%(1000000007);

}
}
}

please help me with this question

hi @madhuragarwal2027_a8d8220ac96f9af4,
there is some issue with the ide so please wait for some time I’ll check it