#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<pair<int, bool> > per(n + m);
  vector<pair<int, int> > leftbest(n + m), rightbest(n + m);
  vector<int> ans(m + n, 0);
  for (int i = 0; i < n + m; i++) scanf(" %d", &per[i].first);
  int leftnow = INT_MAX, ind = 0;
  for (int i = 0; i < n + m; i++) {
    scanf(" %d", &per[i].second);
    if (per[i].second == true) {
      leftnow = per[i].first;
      ind = i;
    } else {
      if (leftnow != INT_MAX) {
        leftbest[i].first = abs(leftnow - per[i].first);
        leftbest[i].second = ind;
      } else {
        leftbest[i].first = INT_MAX;
        leftbest[i].second = ind;
      }
    }
  }
  leftnow = INT_MAX;
  ind = n + m - 1;
  for (int i = n + m - 1; i >= 0; i--) {
    if (per[i].second == true) {
      leftnow = per[i].first;
      ind = i;
    } else {
      if (leftnow != INT_MAX) {
        if (abs(leftnow - per[i].first) < leftbest[i].first) {
          rightbest[i].first = abs(leftnow - per[i].first);
          rightbest[i].second = ind;
        } else {
          rightbest[i].first = leftbest[i].first;
          rightbest[i].second = leftbest[i].second;
        }
      } else {
        rightbest[i].first = leftbest[i].first;
        rightbest[i].second = leftbest[i].second;
      }
      ans[rightbest[i].second]++;
    }
  }
  int j = 0;
  for (int i = 0; i < n + m; i++) {
    if (per[i].second == true) {
      printf("%d ", ans[i]);
      fflush(stdout);
    }
  }
  printf("\n");
  fflush(stdout);
  return 0;
}
