#import"bits/stdc++.h" #define F(i,n) for(int i=0;i>n;F(i,n)cin>>a[i];F(i,2*n-3){F(j,i+1){q=i-j;if(j<0||q<0||j>=n||q>=n||j+q!=i)continue;if(a[j]