#include <bits/stdc++.h>
using namespace std;
long long INF = pow(10, 10);
int main() {
  long long n_riders, n_drivers;
  cin >> n_riders >> n_drivers;
  vector<vector<long long> > residents(n_riders + n_drivers);
  for (long long i = 0; i < n_riders + n_drivers; ++i) {
    long long position;
    cin >> position;
    residents[i].push_back(position);
  }
  map<long long, long long> ans;
  for (long long i = 0; i < n_riders + n_drivers; ++i) {
    long long is_taxi;
    cin >> is_taxi;
    if (is_taxi == 1) {
      ans[i] = 0;
    }
    residents[i].push_back(is_taxi);
    residents[i].push_back(i);
  }
  sort(residents.begin(), residents.end());
  vector<pair<long long, long long> > min_dists(n_riders + n_drivers);
  for (int i = 0; i < n_riders + n_drivers; ++i) {
    min_dists[i].first = INF;
    min_dists[i].second = INF;
  }
  vector<long long> last_taxi = {-1, -1, -1};
  for (auto resident : residents) {
    if (resident[1] == 1) {
      last_taxi = resident;
    } else {
      if (last_taxi[0] != -1) {
        if (min_dists[resident[2]].second > abs(resident[0] - last_taxi[0])) {
          min_dists[resident[2]].second = abs(resident[0] - last_taxi[0]);
          min_dists[resident[2]].first = last_taxi[2];
        }
      }
    }
  }
  reverse(residents.begin(), residents.end());
  last_taxi = {-1, -1, -1};
  for (auto resident : residents) {
    if (resident[1] == 1) {
      last_taxi = resident;
    } else {
      if (last_taxi[0] != -1) {
        if (min_dists[resident[2]].second > abs(resident[0] - last_taxi[0])) {
          min_dists[resident[2]].second = abs(resident[0] - last_taxi[0]);
          min_dists[resident[2]].first = last_taxi[2];
        }
      }
    }
  }
  sort(min_dists.begin(), min_dists.end());
  for (auto dist : min_dists) {
    if (dist.first == INF) {
      break;
    }
    ++ans[dist.first];
  }
  for (auto a : ans) {
    cout << a.second << " ";
  }
}
