#include int main(void){ int i, N, flg0 = 0, flg1 = 0; long long int a, b, maxlen, space = 0; scanf("%d", &N); long long int len[N]; scanf("%lld %lld", &a, &b); len[0] = a + 4*b; maxlen = len[0]; if(len[0]%2){ flg0++; }else{ flg1++; } for(i=1;i0 && flg1>0){ printf("-1\n"); return 0; } if(len[i]>maxlen){ maxlen = len[i]; } } for(i=0;i