#include <bits/stdc++.h>
using namespace std;
struct haha {
  int left;
  int right;
  int pos;
  int biaoji;
};
int ans[200005];
haha ig[200005];
int main() {
  int n, m;
  while (cin >> n >> m) {
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < n + m; i++) cin >> ig[i].pos;
    for (int i = 0; i < n + m; i++) cin >> ig[i].biaoji;
    int we = -1;
    for (int i = 0; i < n + m; i++) {
      if (ig[i].biaoji)
        we = i;
      else
        ig[i].left = we;
    }
    we = -1;
    for (int i = n + m - 1; i >= 0; i--) {
      if (ig[i].biaoji)
        we = i;
      else
        ig[i].right = we;
    }
    for (int i = 0; i < n + m; i++) {
      if (ig[i].biaoji == 0) {
        if (ig[i].left == -1)
          ans[ig[i].right]++;
        else if (ig[i].right == -1)
          ans[ig[i].left]++;
        else if (ig[i].left != -1 && ig[i].right != -1) {
          int m1 = ig[i].pos - ig[ig[i].left].pos;
          int m2 = ig[ig[i].right].pos - ig[i].pos;
          if (m1 <= m2)
            ans[ig[i].left]++;
          else
            ans[ig[i].right]++;
        }
      }
    }
    for (int i = 0; i < n + m; i++) {
      if (ig[i].biaoji) {
        cout << ans[i] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
