#include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout< A; vector temp, con; string S; cin>>N>>S; A.resize(N+1); temp.resize(N, INF); con.resize(N+1); for(int i = 0; i < N; i++){ cin>>A[i+1]; if(S[i] == 'E') con[i+1]++; con[i+1] += con[i]; A[i+1] += A[i]; // cout<<"A "< 0; i--){ // cout<<"i "<>Q; for(int i = 0; i < Q; i++){ int K, ans = 0; cin>>K; ans = upper_bound(temp.begin(), temp.end(), K) - temp.begin(); cout<