#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(30);
  solve();
  return 0;
}
const int N = 200005;
const int MAGIC = 420;
const int lg = 60;
ll x[N], t[N];
int bef[N], aft[N];
int ans[N];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n + m; ++i) {
    cin >> x[i];
  }
  int last_bef = -1;
  for (int i = 0; i < n + m; ++i) {
    cin >> t[i];
    if (t[i] == 1)
      last_bef = i;
    else
      bef[i] = last_bef;
  }
  int last_aft = -1;
  for (int i = n + m - 1; i >= 0; --i) {
    if (t[i] == 1)
      last_aft = i;
    else
      aft[i] = last_aft;
  }
  for (int i = 0; i < n + m; ++i) {
    if (t[i] == 1) continue;
    if (bef[i] == -1) {
      ++ans[aft[i]];
      continue;
    }
    if (aft[i] == -1) {
      ++ans[bef[i]];
      continue;
    }
    if (x[i] - x[bef[i]] <= x[aft[i]] - x[i]) {
      ++ans[bef[i]];
    } else {
      ++ans[aft[i]];
    }
  }
  for (int i = 0; i < n + m; ++i) {
    if (t[i] == 0) continue;
    cout << ans[i] << " ";
  }
  cout << endl;
}
