#include <bits/stdc++.h>
using namespace std;
int ct, a[200005][2], z, ans[200005], mintx, maxtx, n, m;
int bs(int x, int y, int ct) {
  int c = (x + y) / 2;
  if (a[c][0] > ct) return bs(x, c, ct);
  if (a[c][0] < ct && a[c + 1][0] <= ct) return bs(c, y, ct);
  if (a[c][0] <= ct && a[c + 1][0] > ct) return c;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n + m; i++) {
    cin >> a[i][0];
  }
  for (int i = 0; i < n + m; i++) {
    cin >> a[i][1];
    if (a[i][1] == 1) {
      z++;
      mintx = maxtx;
      maxtx = i;
      if (z == 1)
        ans[i] += i;
      else {
        if (mintx + 1 != maxtx) {
          ct = (a[mintx][0] + a[maxtx][0]) / 2;
          int value = bs(mintx, maxtx, ct);
          ans[mintx] += value - mintx;
          ans[maxtx] += maxtx - value - 1;
        }
      }
    }
  }
  ans[maxtx] += n + m - maxtx - 1;
  if (m == 1) return cout << n, 0;
  ;
  for (int i = 0; i < n + m; i++)
    if (a[i][1] == 1) cout << ans[i] << " ";
  return 0;
}
