#include<bits/stdc++.h>

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scanf("%c",&a)
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define pii pair<int,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
# define int long long
inline long long ceil_div(long long a, long long b) { return (a + b - 1) / b; }

using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + (c & 15);
        c = getchar();
    }
    return f * fu;
}


const int N = 2e5 + 10;
pair<ll, int> seq[N];
pair<int, int> stk[N];
int n, m;
ll a[N];
set<int> st;
multiset<int> xst;

inline void ins(int x) {
    auto it = st.lower_bound(x);
    int r = *it, l = *--it;
    xst.erase(xst.find(r - l));
    xst.insert(r - x), xst.insert(x - l);
    st.insert(x);
}

signed main() {
    n = qr(), m = qr();
    for (int i = 1; i <= n; i++)a[i] = a[i - 1] + qr();
    for (int i = 1, t = 1; i <= n - 1; i++) {
        while (t >= 2 &&
               (__int128) (a[i] - stk[t].se) * (i - stk[t - 1].fi) <=
               (__int128) (a[i] - stk[t - 1].se) * (i - stk[t].fi))
            t--;
        seq[i] = {(a[i] - stk[t].se - 1) / (i - stk[t].fi) + 1, i}, stk[++t] = {i, a[i]};
    }
    seq[n] = {(ll) 1e18, n};
    sort(seq + 1, seq + n);
    st.insert(0), st.insert(n), xst.insert(n);
    for (int i = 1, now = 1; i <= m; i++) {
        int v = qr();
        while (v >= seq[now].fi)ins(seq[now++].se);
        printf("%d%c", *--xst.end() - 1, ce(i, m));
    }
    return 0;
}