#include <bits/stdc++.h>
using namespace std;
int n, a[200001], b[200001], m;
int main() {
  cin >> n >> m;
  n = n + m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    if (b[i] == 1) {
      vec.push_back(a[i]);
    }
  }
  vec.push_back(2e9 + 1);
  int l = 0, cnt = 0, r = 1, c = 0;
  while (l < vec.size() - 1 && r <= n) {
    if (b[r] == 0) {
      while (abs(a[r] - vec[l]) > abs(a[r] - vec[l + 1])) {
        cout << cnt << " ";
        c++;
        l++;
        cnt = 0;
      }
      cnt++;
    }
    r++;
  }
  cout << cnt << " ";
  for (int i = 0; i < vec.size() - 2 - c; i++) {
    cout << "0 ";
  }
  return 0;
}
