#include <bits/stdc++.h>
int i, j, k, l, m, n, h, g, t, a[1 << 21], d[1 << 20], r[1 << 20], s[1 << 20],
    *p[2]{r, d};
int main() {
  for (scanf("%d%d", &n, &m); i++ < m + n;) scanf("%d", a + i);
  while (j++ < m + n) scanf("%d", &t), *p[t]++ = a[j];
  while (k++ < n) {
    while (l < m - 1 && 2 * r[k - 1] > d[l] + d[l + 1]) ++l;
    ++s[l];
  }
  while (h++ < m) printf("%d ", s[h - 1]);
}
