#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, d, dsl = 0, arr[200010], dr[200010], ans[200010], v;
  cin >> p >> d;
  for (int i = 1; i <= p + d; i++) cin >> arr[i];
  for (int i = 1; i <= p + d; i++) {
    cin >> v;
    if (v) dr[++dsl] = i;
  }
  if (dr[1] > 1) ans[1] += dr[1] - 1;
  if (dr[d] < p + d) ans[d] += p + d - dr[d];
  for (int i = 1; i < d; i++) {
    int j;
    for (j = dr[i] + 1; j < dr[i + 1]; j++) {
      if (arr[j] - arr[dr[i]] <= arr[dr[i + 1]] - arr[j])
        ans[i]++;
      else
        break;
    }
    ans[i + 1] += dr[i + 1] - j;
  }
  for (int i = 1; i <= d; i++) cout << ans[i] << " ";
  return 0;
}
