#include <bits/stdc++.h>
using namespace std;
int main(void) {
  srand(time(0));
  cout << fixed << setprecision(7);
  cerr << fixed << setprecision(7);
  int n, q;
  scanf("%d%d", &n, &q);
  static long long s[1 << 23];
  for (int i = 1; i <= n; ++i)
    scanf("%I64d", &s[i]), s[i + n] = s[i + n + n] = s[i];
  for (int i = 2; i <= n + n + n; ++i) s[i] += s[i - 1];
  static int nxt[1 << 23];
  for (int i = 1; i <= n; ++i) nxt[i] = i;
  for (int i = n + 1; i <= n + n + n; ++i) nxt[i] = nxt[i - n];
  while (q--) {
    int v;
    scanf("%d", &v);
    if (s[n] <= v) {
      cout << "1\n";
      continue;
    }
    static int a[1 << 22];
    int cnt = 0;
    for (int i = 1; i <= n + n; ++i) {
      while (s[cnt] - s[i - 1] <= v) ++cnt;
      a[i] = cnt;
    }
    int ans = 0;
    cnt = 1;
    for (int i = 1; i <= n; ++i) cnt = nxt[a[cnt]];
    const int lim = cnt + n;
    while (cnt < lim) ++ans, cnt = a[cnt];
    cout << ans << '\n';
  }
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}
