#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> x(n + m), t(n + m);
  for (auto &e : x) cin >> e;
  for (auto &e : t) cin >> e;
  vector<int> last(n + m), next(n + m);
  for (int i = 0; i < n + m; ++i) {
    if (t[i])
      last[i] = i;
    else {
      if (i == 0)
        last[i] = -1;
      else
        last[i] = last[i - 1];
    }
  }
  for (int i = n + m - 1; i >= 0; --i) {
    if (t[i])
      next[i] = i;
    else {
      if (i == n + m - 1)
        next[i] = -1;
      else
        next[i] = next[i + 1];
    }
  }
  vector<int> cnt(n + m);
  for (int i = 0; i < n + m; ++i) {
    if (t[i]) continue;
    if (last[i] == -1)
      cnt[next[i]]++;
    else if (next[i] == -1)
      cnt[last[i]]++;
    else if (x[i] - x[last[i]] <= x[next[i]] - x[i])
      cnt[last[i]]++;
    else
      cnt[next[i]]++;
  }
  for (int i = 0; i < n + m; ++i)
    if (t[i]) cout << cnt[i] << " ";
  cout << endl;
  return 0;
}
