#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
int abs(int a) { return a > 0 ? a : -a; }
int n, m, i, j, k, x, y, a, b, A[200003], B[200003], C[200003], h[200003], s, t;
int main() {
  cin >> n >> m;
  for (int i(0); i < n + m; ++i) {
    cin >> h[i];
  }
  if (m == 1) {
    cout << n << endl;
    return 0;
  }
  for (int i(0); i < n + m; ++i) {
    int type;
    cin >> type;
    if (type)
      B[++s] = h[i];
    else
      A[++t] = h[i];
  }
  int idx = 1;
  for (int i(1); i <= n; ++i) {
    while (idx < m and abs(B[idx + 1] - A[i]) < abs(B[idx] - A[i])) idx++;
    C[idx]++;
  }
  for (int i(1); i <= m; ++i) cout << C[i] << " ";
  cout << endl;
}
