#include"bits/stdc++.h" #define rep(i,n) for(ll i=0;i> n >> q; vectorb; b.push_back(0); rep(i, n) { ll a; cin >> a; rep(j, a) { b.push_back(b.back() + j + 1); } } rep(idx, q) { ll s; cin >> s; auto itr = lower_bound(ALL(b), s); if(itr == b.end()) cout << -1 << endl; else cout << itr - b.begin() << endl; } }