#include <bits/stdc++.h>
using namespace std;
int ANS[1000010];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  int a[n + m + 10];
  bool d[n + m + 10];
  for (int i = 1; i <= n + m; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n + m; i++) {
    cin >> d[i];
  }
  int LEFT[m + n + 10], RIGHT[m + n + 10], pivot = -1;
  for (int i = m + n; i > 0; i--) {
    if (d[i] == 1) pivot = i;
    RIGHT[i] = -1;
    if (pivot != -1) RIGHT[i] = pivot;
  }
  pivot = -1;
  for (int i = 1; i <= m + n; i++) {
    if (d[i] == 1) pivot = i;
    LEFT[i] = -1;
    if (pivot != -1) LEFT[i] = pivot;
  }
  for (int i = 1; i <= n + m; i++) {
    if (d[i] == 0) {
      if (LEFT[i] == -1) {
        ANS[RIGHT[i]]++;
      } else if (RIGHT[i] == -1)
        ANS[LEFT[i]]++;
      else {
        if (abs(a[i] - a[LEFT[i]]) <= abs(a[i] - a[RIGHT[i]]))
          ANS[LEFT[i]]++;
        else
          ANS[RIGHT[i]]++;
      }
    }
  }
  for (int i = 1; i <= m + n; i++)
    if (d[i]) cout << ANS[i] << " ";
}
