#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, m, a[maxn], ans[maxn], lc[maxn], topt;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n + m; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n + m; i++) {
    int x;
    scanf("%d", &x);
    if (x == 1) lc[++topt] = i;
  }
  ans[1] += lc[1] - 1;
  ans[m] += n + m - lc[m];
  for (int i = 1; i <= m - 1; i++) {
    int k = (a[lc[i + 1]] + a[lc[i]]) / 2;
    int ll = upper_bound(a + lc[i] + 1, a + lc[i + 1], k) - a;
    ans[i] += ll - 1 - lc[i];
    ans[i + 1] += lc[i + 1] - ll;
  }
  for (int i = 1; i <= m; i++) printf("%d ", ans[i]);
  return 0;
}
