ll@N,@A[N],d[N]{};REP(i,N-2)d[i+1]=(A[i]A[i+1])+d[i+1];wt(sum(d(N)));