#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int x[N], t[N], nxt[N], prv[N], ans[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n + m; i++) cin >> x[i];
  for (int i = 0; i < n + m; i++) cin >> t[i];
  for (int i = 0; i < n + m; i++) {
    if (t[i])
      prv[i] = i;
    else if (i)
      prv[i] = prv[i - 1];
    else
      prv[i] = -1;
  }
  for (int i = n + m - 1; i >= 0; i--) {
    if (t[i])
      nxt[i] = i;
    else if (i + 1 != n + m)
      nxt[i] = nxt[i + 1];
    else
      nxt[i] = -1;
  }
  for (int i = 0; i < n + m; i++) {
    if (t[i]) continue;
    if (prv[i] == -1)
      ans[nxt[i]]++;
    else if (nxt[i] == -1)
      ans[prv[i]]++;
    else if (x[i] - x[prv[i]] <= x[nxt[i]] - x[i])
      ans[prv[i]]++;
    else
      ans[nxt[i]]++;
  }
  for (int i = 0; i < n + m; i++) {
    if (t[i]) cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
