#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int google_itr = 1;
int popcount(int num) {
  num = num - ((num >> 1) & 0x55555555);
  num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
  return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}
void virus() {
  int res, tax, cnt = 0;
  cin >> res >> tax;
  vector<int> res_c(res + tax), pass;
  vector<pair<int, int>> driv;
  for (auto i = 0; i < res + tax; i++) cin >> res_c[i];
  for (auto i = 0; i < res + tax; i++) {
    int temp;
    cin >> temp;
    if (temp)
      driv.push_back({res_c[i], cnt++});
    else
      pass.push_back(res_c[i]);
  }
  sort(driv.begin(), driv.end());
  vector<int> ans(tax);
  for (auto i = 0; i < res; i++) {
    int posn = lower_bound(driv.begin(), driv.end(), make_pair(pass[i], 0)) -
               driv.begin();
    if (posn == 0) {
      ans[driv[posn].second]++;
    } else {
      if (abs(driv[posn - 1].first - pass[i]) <=
          abs(driv[posn].first - pass[i]))
        ans[driv[posn - 1].second]++;
      else
        ans[driv[posn].second]++;
    }
  }
  for (auto i : ans) cout << i << " ";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    auto start = high_resolution_clock::now();
    virus();
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<seconds>(stop - start);
  }
  return 0;
}
