#include <bits/stdc++.h>
using namespace std;
vector<int> mcercano, d, ist;
int n, m;
int main() {
  cin >> n >> m;
  d = vector<int>(n + m);
  ist = vector<int>(n + m);
  for (int i = 0; i < n + m; i++) {
    cin >> d[i];
  }
  for (int i = 0; i < n + m; i++) {
    cin >> ist[i];
  }
  if (m == 1) {
    cout << n << endl;
    exit(0);
  }
  mcercano = vector<int>(n + m, -1);
  for (int i = 0; i < n + m; i++) {
    if (ist[i] == 1) mcercano[i] = -1;
  }
  int ftaxi = 0;
  while (ist[ftaxi] != 1) {
    mcercano[ftaxi] = 0;
    ftaxi++;
  }
  int currTaxi = 0;
  for (int i = ftaxi; i < n + m;) {
    int nextTaxi = -1;
    for (int j = i + 1; j < n + m; j++) {
      if (ist[j] == 1) {
        nextTaxi = j;
        break;
      }
    }
    if (nextTaxi == -1) {
      i++;
      while (i < n + m) {
        mcercano[i] = currTaxi;
        i++;
      }
    } else {
      for (int j = i + 1; j < nextTaxi; j++) {
        if ((d[j] - d[i]) <= (d[nextTaxi] - d[j])) {
          mcercano[j] = currTaxi;
        } else {
          mcercano[j] = currTaxi + 1;
        }
      }
      currTaxi++;
      i = nextTaxi;
    }
  }
  vector<int> taxs(m, 0);
  for (int i = 0; i < n + m; i++) {
    if (mcercano[i] >= 0) taxs[mcercano[i]]++;
  }
  for (int i = 0; i < m; i++) {
    cout << taxs[i] << " ";
  }
  cout << endl;
}
