#include <bits/stdc++.h>
void read();
const int N = 1e5 + 100;
const int M = 2e5 + 100;
const long long oo = 1e18;
using namespace std;
bool taxi[M];
int ans[M];
int main() {
  long long n, m;
  cin >> n >> m;
  vector<int> v(M);
  vector<pair<int, int> > val(M);
  for (int i = 0; i < n + m; i++) cin >> v[i];
  for (int i = 0; i < n + m; i++) cin >> taxi[i];
  int las = -1;
  int dx = -1;
  for (int i = 0; i < n + m; i++) {
    if (taxi[i]) {
      las = v[i], dx = i;
      continue;
    }
    if (dx == -1) continue;
    val[i].first = abs(las - v[i]);
    val[i].second = dx;
  }
  las = -1;
  dx = -1;
  for (int i = n + m - 1; i >= 0; i--) {
    if (taxi[i]) {
      las = v[i], dx = i;
      continue;
    }
    if (dx == -1) continue;
    int u = abs(las - v[i]);
    if (u < val[i].first || val[i].first == 0) val[i].second = dx;
  }
  for (int i = 0; i < n + m; i++) {
    if (taxi[i]) continue;
    ans[val[i].second]++;
  }
  for (int i = 0; i < n + m; i++) {
    if (taxi[i]) cout << ans[i] << " ";
  }
  return 0;
}
void read() {
  freopen("in.txt", "r", stdin);
  freopen("ou.txt", "w", stdout);
}
