#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> pep, tx;
  long long a[n + m];
  for (long long i = 0; i < n + m; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n + m; i++) {
    long long x;
    cin >> x;
    if (x) {
      tx.push_back(a[i]);
    } else {
      pep.push_back(a[i]);
    }
  }
  sort(pep.begin(), pep.end());
  sort(tx.begin(), tx.end());
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    vector<long long>::iterator it;
    it = upper_bound(tx.begin(), tx.end(), pep[i]);
    if (it == tx.begin()) {
      mp[*it]++;
    } else {
      vector<long long>::iterator it1;
      it1 = it;
      --it1;
      if (abs(pep[i] - *it1) <= abs(pep[i] - *it)) {
        mp[*it1]++;
      } else {
        mp[*it]++;
      }
    }
  }
  map<long long, long long>::iterator itt;
  for (long long i = 0; i < m; i++) {
    if (mp.find(tx[i]) == mp.end()) {
      cout << 0 << " ";
      continue;
    }
    cout << mp[tx[i]] << " ";
  }
}
