#ifndef LOCAL
#define NDEBUG 1
#endif // LOCAL
#include<bits/stdc++.h>

std::vector<int> parent;
std::vector<int64_t> prefSum;

void init(int n_vertex) {
        assert(n_vertex<=parent.size());
        for (int i=0; i<n_vertex; ++i) parent[i]=i;
}

int findparent(int vertex) {
        assert(vertex<parent.size());
        return (parent[vertex]==vertex ? vertex: parent[vertex]=findparent(parent[vertex]));
}

long double parity(int left, int right) {
        ++left, ++right;
        assert(left<=right and left>0 and right<prefSum.size());
        return 1.0*(prefSum[right]-prefSum[left-1])/(right-left+1);
}

int main() {
        std::ios_base::sync_with_stdio(0); std::cin.tie(0);

        int n_bread, n_comsumer; std::cin>>n_bread>>n_comsumer;

        std::vector<int> breads(n_bread);
        prefSum.assign(n_bread+1, 0);
        for (int i=0; i<n_bread; ++i) {
                std::cin>>breads[i]; 
                prefSum[i+1]=prefSum[i]+breads[i];
        }

        std::vector<int> comsumers(n_comsumer);
        for (auto& c: comsumers) std::cin>>c;

        int idx=n_comsumer-1;

        parent.resize(n_bread+5);
        init(n_bread+5);

        std::set< std::pair<long double, int> > segList;
        for (int i=0; i<n_bread-1; ++i) segList.emplace(-breads[i], i);

        std::vector<int> result(n_comsumer, 0);
        int ret=0;
        while (!segList.empty()) {
                while (idx>=0 and comsumers[idx]>=-segList.begin()->first) result[idx--]=ret;
                if (idx<0) break;

                int x=segList.begin()->second;
                int nxt=findparent(x);
                segList.erase({-parity(x, nxt), x});

                parent[nxt]=nxt+1;
                if (findparent(nxt)!=n_bread-1) {
                        segList.erase({-parity(nxt+1, findparent(nxt+1)), nxt+1});
                        segList.emplace(-parity(x, findparent(x)), x);
                }

                ret=std::max(ret, findparent(x)-x);
        }
        while (idx>=0) result[idx--]=n_bread-1;

        for (auto& ret: result) std::cout<<ret<<" ";

        return 0;
}