#include #define debug(x) cerr<<#x<<" = "< #define mp make_pair #define pb push_back using namespace std; inline LL read(){ LL nm=0; bool fh=1; char cw=getchar(); for(;!isdigit(cw);cw=getchar()) fh^=(cw=='-'); for(;isdigit(cw);cw=getchar()) nm=nm*10+(cw-'0'); return fh?nm:-nm; } #define mod 1000000007 namespace CALC{ inline int add(int x,int y){return (x+y>=mod)?(x+y-mod):(x+y);} inline int mns(int x,int y){return (x-y<0)?(x-y+mod):(x-y);} inline int mul(LL x,LL y){return x*y%mod;} inline void upd(int &x,int y){x=(x+y>=mod)?(x+y-mod):(x+y);} inline void dec(int &x,int y){x=(x-y<0)?(x-y+mod):(x-y);} inline int qpow(int x,int sq){LL res=1;for(;sq;sq>>=1,x=mul(x,x))if(sq&1)res=mul(res,x);return res;} }using namespace CALC; #define M 100020 int n,iv[M],a[M]; inline int solve(){ n=read();for(int i=1;i<=n;i++) a[i]=(read()>>1); reverse(a+1,a+n+1); int ans=a[n]; for(int i=1;i