#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  long long a[200000], b[200000];
  long long ans[200000];
  map<long long, long long> mp;
  long long i, j;
  vector<long long> v;
  cin >> n >> m;
  for (i = 1; i <= n + m; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= n + m; i++) {
    cin >> b[i];
    if (b[i] == 1) {
      mp[a[i]] = 1;
      v.push_back(i);
    }
  }
  ans[1] += v[0] - 1;
  ans[m] += n + m - v[v.size() - 1];
  long long k = 0, z = 1;
  for (i = v[0] + 1; i < v[v.size() - 1]; i++) {
    if (mp[a[i]] == 0) {
      long long diff1 = abs(a[i] - a[v[k]]);
      long long diff2 = abs(a[i] - a[v[k + 1]]);
      if (diff1 <= diff2) {
        ans[z]++;
        continue;
      } else {
        ans[z + 1]++;
        continue;
      }
    }
    if (mp[a[i]] == 1) {
      z++;
      k++;
      continue;
    }
  }
  for (i = 1; i <= m; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
