#define MD 998244353 ll@N,@A[N];Mint t=2;wt(sum[i,0,N](A[i]*(t**max(i,N-2)+i*t**max(0,i-1,N-i-2,N-3))));