#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, tmp, c1, c2, total;
  scanf("%d%d", &n, &m);
  total = n + m;
  int p[total], t[m];
  for (i = 0; i < total; ++i) scanf("%d", &p[i]);
  for (i = 0, j = 0; i < total; ++i) {
    scanf("%d", &t[j]);
    if (t[j]) t[j] = i, j++;
  }
  c1 = t[0];
  for (i = 1; i < m; ++i) {
    c2 = 0;
    for (j = t[i - 1] + 1; j < t[i]; ++j) {
      if (abs(p[t[i - 1]] - p[j]) <= abs(p[t[i]] - p[j]))
        c1++;
      else
        c2++;
    }
    printf("%d ", c1);
    c1 = c2;
  }
  printf("%d\n", c1 + total - t[m - 1] - 1);
  return 0;
}
