#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> dist(n + m);
  vector<long long> used(n + m);
  for (long long i = 0; i < n + m; ++i) {
    cin >> dist[i];
  }
  set<pair<long long, long long>> st;
  for (long long i = 0; i < n + m; ++i) {
    cin >> used[i];
    if (used[i]) {
      st.insert({dist[i], i});
    }
  }
  vector<long long> ans(n + m);
  for (long long i = 0; i < n + m; ++i) {
    if (!used[i]) {
      auto it = st.lower_bound({dist[i], -1});
      if (it != st.begin() && it != st.end()) {
        auto it2 = it;
        --it;
        if (abs(dist[i] - it->first) <= abs(dist[i] - it2->first)) {
          ans[it->second]++;
        } else {
          ans[it2->second]++;
        }
      } else if (it == st.begin()) {
        ans[it->second]++;
      } else {
        --it;
        ans[it->second]++;
      }
    }
  }
  for (long long i = 0; i < n + m; ++i) {
    if (used[i]) cout << ans[i] << " ";
  }
}
