#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    int an[200000 + 5], am[200000 + 5], car[200000 + 5], ans[200000 + 5],
        count = 0;
    for (int i = 0; i < n + m; i++) cin >> an[i];
    for (int i = 0; i < n + m; i++) {
      cin >> am[i];
      if (am[i] == 1) car[count++] = an[i];
    }
    memset(ans, 0, sizeof(ans));
    int left, right = 0;
    for (int i = 0; i < n + m; i++) {
      if (am[i]) {
        left = right;
        right++;
      } else {
        if (right == 0 && an[i] < car[right])
          ans[right]++;
        else if (right == m)
          ans[right - 1]++;
        else if (an[i] - car[left] > car[right] - an[i])
          ans[right]++;
        else
          ans[left]++;
      }
    }
    for (int i = 0; i < m - 1; i++) cout << ans[i] << " ";
    cout << ans[m - 1] << endl;
  }
  return 0;
}
