#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; #define REP(i, n) for(int i=0; i<(n); ++i) #define FOR(i, a, b) for(int i=(a); i<(b); ++i) #define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i) #define DEBUG(x) cout<<#x<<": "<<(x)<<'\n' #define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '< inline void CHMAX(T& a, const T b) {if(a inline void CHMIN(T& a, const T b) {if(a>b) a=b;} constexpr ll MOD=1000000007ll; // constexpr ll MOD=998244353ll; #define FIX(a) ((a)%MOD+MOD)%MOD const double EPS=1e-11; #define EQ0(x) (abs((x))>n>>s; REP(i, n){ cin>>a[i]; b[i]=a[i]; } string t=s; reverse(ALL(t)); reverse(b, b+n); cin>>Q; while(Q--){ ll k; cin>>k; int ans=0; { int r=0, cnt=0; ll sum=0; REP(l, n){ while((r<=l) || (r