#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, m;
  cin >> n >> m;
  long long dumm[n + m + 10], taa[n + m + 10];
  for (i = 0; i < n + m; i++) cin >> dumm[i + 1];
  for (i = 0; i < n + m; i++) cin >> taa[i + 1];
  dumm[n + m + 1] = 2000000002;
  dumm[0] = -2000000002;
  taa[0] = 1;
  taa[n + m + 1] = 1;
  long long ans[n + m + 10];
  memset(ans, 0, sizeof(ans));
  int pre = 0;
  j = 0;
  for (i = 1; i <= n + m; i++) {
    if (taa[i] == 0) {
      while (j <= i) {
        if (taa[j] == 1) pre = j;
        j++;
      }
      while (taa[j] != 1) j++;
      if (dumm[i] - dumm[pre] <= dumm[j] - dumm[i])
        ans[pre]++;
      else
        ans[j]++;
    }
  }
  bool ff = 1;
  for (i = 1; i <= m + n; i++)
    if (taa[i] == 1) cout << (ff == 0 ? " " : "") << ans[i], ff = 0;
  cout << endl;
}
