#include <bits/stdc++.h>
using namespace std;
long int fast() {
  register long int val = 0;
  char c = getchar();
  while (c < 33) c = getchar();
  while (c > 33) val = (val << 1) + (val << 3) + (c - '0'), c = getchar();
  return val;
}
bool isprime(long int n) {
  for (long int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long int gcd(long int a, long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int fastt() {
  register long long int c = getchar();
  register long long int x = 0;
  register long long int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
  return x;
}
int main() {
  long int n, m, i, j, k, t;
  cin >> n >> m;
  vector<pair<long int, pair<int, long int> > > x;
  for (i = 0; i < n + m; i++) {
    cin >> k;
    x.push_back(make_pair(k, make_pair(0, i)));
  }
  for (i = 0; i < n + m; i++) {
    cin >> t;
    x[i].second.first = t;
  }
  sort(x.begin(), x.end());
  long int ans[n + m + 1];
  for (i = 0; i <= n + m; i++) ans[i] = 0;
  long int left[n + m + 1], right[n + m + 1];
  for (i = 0; i < n + m; i++) {
    if (x[i].second.first == 0) {
      if (i == 0) {
        left[i] = -1;
        continue;
      }
      left[i] = left[i - 1];
    } else
      left[i] = i;
  }
  for (i = n + m - 1; i >= 0; i--) {
    if (x[i].second.first == 0) {
      if (i == (n + m - 1)) {
        right[i] = -1;
        continue;
      }
      right[i] = right[i + 1];
    } else
      right[i] = i;
  }
  for (i = 0; i < n + m; i++) {
    if (x[i].second.first == 0) {
      if (left[i] == -1) {
        ans[right[i]]++;
        continue;
      }
      if (right[i] == -1) {
        ans[left[i]]++;
        continue;
      }
      if (abs(x[left[i]].first - x[i].first) <=
          abs(x[right[i]].first - x[i].first)) {
        ans[left[i]]++;
      } else
        ans[right[i]]++;
    }
  }
  vector<pair<long int, long int> > r;
  for (i = 0; i < n + m; i++) {
    if (x[i].second.first) {
      r.push_back(make_pair(x[i].second.second, ans[i]));
    }
  }
  sort(r.begin(), r.end());
  for (i = 0; i < r.size(); i++) cout << r[i].second << " ";
}
