#include #define REP(i,n,N) for(int i=(n);i<(int) N;i++) using namespace std; int a[2017]; int main() { int n; cin>>n; REP(i,0,n) cin>>a[i]; REP(i,1,2*n-3){ REP(p,0,i+1){ if(p>=n||1-p>=n) break; if(a[p]