#include #define REP(i,n) for(int i=0,i##_len=int(n);i>N; vector A(2*N); REP(i,2*N) cin>>A[i]; int l=0,r=2*N-1; ll ans=0; while(lR){ ans+=L; l+=2; } else{ ans+=R; r-=2; } } cout<