#include <bits/stdc++.h>
using namespace std;
long long n, c, m, s, flag = 2, res, temp, i, x, y;
vector<long long> v1, v2, v3, v4;
vector<pair<long long, long long> > vp;
int main() {
  cin >> n >> m;
  long long b[1000000] = {0};
  for (i = 0; i < n + m; i++) {
    cin >> x;
    v3.push_back(x);
  }
  for (i = 0; i < n + m; i++) {
    cin >> x;
    v4.push_back(x);
  }
  if (m == 1) return cout << n, 0;
  for (i = 0; i < v3.size(); i++) {
    if (v4[i] == 0)
      v1.push_back(v3[i]);
    else
      v2.push_back(v3[i]);
  }
  for (i = 0; i < v1.size(); i++) {
    x = upper_bound(v2.begin(), v2.end(), v1[i]) - v2.begin();
    if (x == v1.size())
      b[x - 1]++;
    else {
      if (abs(v2[x - 1] - v1[i]) <= abs(v2[x] - v1[i]))
        b[x - 1]++;
      else
        b[x]++;
    }
  }
  for (i = 0; i < m; i++) cout << b[i] << " ";
  return 0;
}
