#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

ll a[MAX_N];
int n,Q;

ll cnt(ll x)
{
	int l=0,r=0;
	ll res=0;
	ll win=0;
	while(r<=n+1){
		if(win<=x){
			win += a[r];
			r++;
		}else{
			res += r-l-1;
			win -= a[l];
			l++;
		}
	}
	return res;
}

int main()
{
	scanf("%d%d",&n,&Q);
	rep(i,n){
		scanf("%lld",&a[i]);
	}
	a[n] = (1LL<<60);
	rep(i,Q){
		ll x;
		scanf("%lld",&x);
		printf("%lld\n",cnt(x));
	}
	return 0;
}