#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int arr[n];
  long long int queries[m];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < m; i++) cin >> queries[i];
  long long int A[n + 1];
  long long int soma = 0;
  A[0] = 0;
  for (int i = 0; i < n; i++) {
    soma += arr[i];
    A[0] = min(A[0], soma);
  }
  for (int i = 0; i < n; i++) {
    int h = -1;
    long long int answer = A[i];
    long long int sum = 0;
    long long int accmin[n];
    accmin[0] = 0;
    for (int j = 0; j < n - 1; j++) {
      sum += arr[j];
      accmin[j + 1] = min(sum, accmin[j]);
    }
    sum += arr[n - 1];
    long long int peak = sum;
    for (int j = n - 1; j > 0; j--) {
      peak = min(peak, sum);
      long long int candidate = min(accmin[j - 1], peak - arr[j - 1]);
      if (answer < candidate) {
        answer = candidate;
        h = j - 1;
      }
      sum -= arr[j];
    }
    if (accmin[n - 1] > answer) {
      answer = accmin[n - 1];
      h = n - 1;
    }
    if (h != -1) {
      arr[h] = 0;
    }
    A[i + 1] = answer;
  }
  for (int q = 0; q < m; q++) {
    int lo, hi;
    hi = n;
    lo = -1;
    while (hi - lo > 1) {
      int mid = (hi + lo) / 2;
      if (A[mid] + queries[q] < 0)
        lo = mid;
      else
        hi = mid;
    }
    cout << hi << " ";
  }
  cout << endl;
  return 0;
}
