#include <bits/stdc++.h>
using namespace std;
pair<int, int> b[200001];
int a[200001], t[200001], ans[200001];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n + m; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n + m; i++) {
    cin >> t[i];
  }
  int last = -1;
  for (int i = 1; i <= n + m; i++) {
    if (t[i]) {
      last = i;
      continue;
    }
    b[i].first = last;
  }
  last = -1;
  for (int i = n + m; i >= 1; i--) {
    if (t[i]) {
      last = i;
      continue;
    }
    b[i].second = last;
  }
  for (int i = 1; i <= n + m; i++) {
    if (t[i]) continue;
    int x = b[i].first, y = b[i].second;
    if (x == -1 || y == -1) {
      int mx = (x > y ? x : y);
      ans[mx]++;
      continue;
    }
    if (a[i] - a[x] <= a[y] - a[i]) {
      ans[x]++;
      continue;
    }
    ans[y]++;
  }
  for (int i = 1; i <= n + m; i++) {
    if (!t[i]) continue;
    cout << ans[i] << " ";
  }
}
