#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a1, b1;
  for (long long i = 0; i <= n + m - 1; ++i) {
    long long x;
    cin >> x;
    a1.push_back(x);
  }
  for (long long i = 0; i <= n + m - 1; ++i) {
    long long y;
    cin >> y;
    b1.push_back(y);
  }
  vector<long long> a, b;
  for (long long i = 0; i <= n + m - 1; ++i) {
    if (b1[i] == 0)
      a.push_back(a1[i]);
    else
      b.push_back(a1[i]);
  }
  map<long long, long long> ma;
  for (long long i = 0; i <= n - 1; ++i) {
    std::vector<long long>::iterator up;
    up = std::upper_bound(b.begin(), b.end(), a[i]);
    long long pos = up - b.begin();
    if (pos == 0) {
      ma[b[pos]]++;
    } else if (pos == n)
      ma[b[pos - 1]]++;
    else {
      long long val1 = pos - 1, val2 = pos;
      if (abs(b[val1] - a[i]) <= abs(b[val2] - a[i])) {
        ma[b[val1]]++;
      } else
        ma[b[val2]]++;
    }
  }
  long long len = b.size();
  for (long long i = 0; i < len; ++i) cout << ma[b[i]] << " ";
  cout << endl;
  return 0;
}
