#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],
        sum = 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]) car[sum++] = an[i];
    }
    memset(ans, 0, sizeof(ans));
    int left = -1, right = 0;
    for (int i = 0; i < n + m; i++) {
      if (am[i]) {
        left++;
        right++;
      } else if (!am[i]) {
        if (left == -1)
          ans[right]++;
        else if (right == m)
          ans[left]++;
        else if (left != -1 && right != m) {
          if ((an[i] - car[left]) <= (car[right] - an[i]))
            ans[left]++;
          else
            ans[right]++;
        }
      }
    }
    for (int i = 0; i < m; i++) cout << ans[i] << " ";
  }
  return 0;
}
