#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, cnt1;
long long pos[300010], dir[300010];
struct Node {
  long long dis;
  long long num;
} car[300010];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m + n; i++) cin >> pos[i];
  for (int i = 1; i <= n + m; i++) {
    cin >> dir[i];
    if (dir[i] == 1) {
      cnt1++;
      car[cnt1].dis = pos[i];
    }
  }
  for (int i = 1; i <= n + m; i++) {
    if (m == 1) {
      cout << n + m - 1 << endl;
      return 0;
    }
    if (pos[i] < car[1].dis)
      car[1].num++;
    else if (pos[i] > car[cnt1].dis)
      car[cnt1].num = car[cnt1].num + 1;
    else if (dir[i] == 1)
      cnt++;
    else if (pos[i] * 2 > car[cnt].dis + car[cnt + 1].dis)
      car[cnt + 1].num++;
    else
      car[cnt].num++;
  }
  for (int i = 1; i <= cnt1; i++) {
    cout << car[i].num;
    printf("%s", i != cnt1 ? " " : "\n");
  }
  return 0;
}
