#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long x[n + m + 1], t[n + m + 1], f[n + m + 1];
  vector<long long> ans;
  for (int i = 1; i <= m + n; i++) cin >> x[i];
  x[0] = 0;
  long long h0 = 0, c = 0, z = 0;
  for (int i = 1; i <= n + m; i++) {
    cin >> t[i];
    if (t[i] == 1) ans.push_back(0);
    if (t[i] == 1 && h0 == 0) h0 = i;
  }
  ans[0] = h0 - 1;
  for (int i = h0 + 1; i <= n + m; i++)
    if (t[i] == 1) {
      for (int j = h0 + 1; j < i; j++)
        if (x[j] - x[h0] <= x[i] - x[j])
          ans[z]++;
        else
          ans[z + 1]++;
      h0 = i;
      z++;
    }
  ans[ans.size() - 1] += (n + m) - h0;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
