#include <bits/stdc++.h>
using namespace std;
long long int m, n;
long long int people[200010];
long long int c_or_d[200010];
long long int leftdriver[200010];
long long int rightdriver[200010];
long long int driverans[200010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> m >> n;
  for (long long int i = 1; i <= m + n; i++) cin >> people[i];
  for (long long int i = 1; i <= m + n; i++) cin >> c_or_d[i];
  long long int driverplace = -1;
  for (long long int i = 1; i <= m + n; i++) {
    if (c_or_d[i] == 1)
      driverplace = i;
    else
      leftdriver[i] = driverplace;
  }
  driverplace = -1;
  for (long long int i = m + n; i >= 1; i--) {
    if (c_or_d[i] == 1)
      driverplace = i;
    else
      rightdriver[i] = driverplace;
  }
  for (long long int i = 1; i <= m + n; i++) {
    if (c_or_d[i] == 1) continue;
    long long int left = 10000000000;
    long long int right = 10000000000;
    if (leftdriver[i] != -1) left = abs(people[i] - people[leftdriver[i]]);
    if (rightdriver[i] != -1) right = abs(people[i] - people[rightdriver[i]]);
    if (left <= right)
      driverans[leftdriver[i]]++;
    else
      driverans[rightdriver[i]]++;
  }
  for (int i = 1; i <= m + n; i++) {
    if (c_or_d[i] == 1) cout << driverans[i] << " ";
  }
  cout << endl;
  return 0;
}
