wrong answer

#include
#include
#include
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T–){
int n,diff,a[100000],b[100000];
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(int i=0;i<n;i++)
{
scanf("%d",&b[i]);
}
int flag=0;

for(int i=0;i<=n-3;i++)
{
  if(a[i]>b[i])
  {
    printf("NIE\n");
    break;
  }
  else if(a[i]==b[i])
  continue;
  else
  {
    diff=b[i]-a[i];
    a[i]+=diff;
    a[i+1]=a[i+1]+2*diff;
    a[i+2]=a[i+2]+3*diff;

    flag=1;
  }

}
if(flag!=0)
{
if( a[n-2]==b[n-2] && a[n-1]==b[n-1])
printf(“TAK\n”);
else
printf(“NIE\n”);
}}

return 0;}

this code is working for all test cases but still getting wrong answer

//