#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  std::vector<pair<long long, long long> > v(n + m);
  for (long long i = 0; i <= n + m - 1; i++) {
    cin >> v[i].first;
  }
  std::vector<long long> z(n + m, INT_MAX), ans(n + m, -1);
  bool found = 0;
  long long start = -1, end = -1;
  for (long long i = 0; i <= n + m - 1; i++) {
    cin >> v[i].second;
    if (!found && v[i].second) {
      found = 1;
      start = i;
    }
    if (v[i].second) {
      end = i;
      z[i] = 0;
    }
  }
  long long nearest_driver = start;
  map<long long, long long> xx;
  for (long long i = start + 1; i <= n + m - 1; i++) {
    if (v[i].second) {
      nearest_driver = i;
      z[i] = 0;
    } else {
      if (z[i] > v[i].first - v[nearest_driver].first) {
        z[i] = v[i].first - v[nearest_driver].first;
        ans[i] = nearest_driver;
        xx[nearest_driver]++;
      }
    }
  }
  nearest_driver = end;
  for (long long i = end - 1; i >= 0; i--) {
    if (v[i].second) {
      nearest_driver = i;
    } else {
      if (z[i] > v[nearest_driver].first - v[i].first) {
        z[i] = v[nearest_driver].first - v[i].first;
        if (ans[i] != -1) {
          xx[ans[i]]--;
        }
        ans[i] = nearest_driver;
        xx[nearest_driver]++;
      }
    }
  }
  for (long long i = 0; i <= n + m - 1; i++) {
    if (!v[i].second) {
      xx[ans[i]]++;
    }
  }
  for (long long i = 0; i <= n + m - 1; i++) {
    if (v[i].second) {
      cout << xx[i] / 2 << " ";
    }
  }
  cout << endl;
  return 0;
}
