#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n + m + 100], b[n + m + 100], ans[m + 10];
  for (int i = 1; i <= n + m; i++) {
    cin >> a[i];
  }
  vector<pair<long long, long long> > v;
  long long k = 0;
  for (int i = 1; i <= n + m; i++) {
    cin >> b[i];
    if (b[i]) v.push_back({a[i], ++k});
  }
  k = 0;
  memset(ans, 0, sizeof ans);
  for (int i = 1; i < m + n + 1; i++) {
    if (b[i] == 0) {
      long long t = abs(a[i] - v[k].first);
      while (k + 1 < v.size() && t > abs(a[i] - v[k + 1].first)) {
        t = abs(a[i] - v[k + 1].first);
        k++;
      }
      ans[v[k].second]++;
    }
  }
  for (int i = 1; i <= m; i++) cout << ans[i] << " ";
  cout << endl;
}
