#include <bits/stdc++.h>
using namespace std;
int i;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<pair<long long int, int> > v(n + m);
  for (i = 0; i < n + m; i++) cin >> v[i].first;
  for (i = 0; i < n + m; i++) cin >> v[i].second;
  long long int q = -1;
  vector<pair<long long int, int> > w(n + m);
  for (i = 0; i < n + m; i++) {
    if (v[i].second == 1)
      q = i;
    else
      w[i].first = q;
  }
  q = -1;
  for (i = (m + n - 1); i >= 0; i--) {
    if (v[i].second == 1)
      q = i;
    else
      w[i].second = q;
  }
  long long int ans[n + m];
  memset(ans, 0, sizeof(ans));
  for (i = 0; i < n + m; i++) {
    if (v[i].second == 0) {
      long long int a = w[i].first;
      long long int b = w[i].second;
      long long int c = v[i].first;
      if (a == -1 || b == -1) {
        if (a == -1)
          ans[b]++;
        else
          ans[a]++;
      } else if ((c - v[a].first) <= (v[b].first - c))
        ans[a]++;
      else
        ans[b]++;
    }
  }
  for (i = 0; i < n + m; i++)
    if (v[i].second == 1) cout << ans[i] << " ";
}
