#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<ll, ll>
#define f first
#define s second

const int mxn = 200001;
int n, q;
ll a[mxn], b[mxn], r[mxn];

int f(int x){
	return r[x] - x + 1;
}

auto cmp = [](pi x, pi y){
	ll v = x.f * f(y.s) - y.f * f(x.s);
	return v ? v > 0 : x.s < y.s; 
};
set<pi, decltype(cmp)> s(cmp);

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> q;
	
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		r[i] = i;
		if(i < n) s.insert({a[i], i});
		a[i] += a[i - 1];
	}
	
	for(int i = 0; i < q; i++) cin >> b[i];
	
	for(int i = q - 1; ~i; i--){
		int ret = b[i + 1];
		while(!s.empty() && b[i] * f(s.begin()->s) < s.begin()->f){
			int x = s.begin()->s, y = r[x] + 1;
			s.erase(s.begin());
			r[x] = r[y];
			if(r[y] != n){
				s.erase({a[r[y]] - a[y - 1], y});
				s.insert({a[r[x]] - a[x - 1], x});
			}
			ret = max(ret, f(x) - 1);
		}
		b[i] = ret;
	}
	
	cout << b[0];
	for(int i = 1; i < q; i++) cout << " " << b[i];
	cout << endl;

	return 0;
}