#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> vec;
  cin >> n >> m;
  vec.resize(n + m);
  for (int i = 0; i < n + m; i++) {
    cin >> vec[i];
  }
  vector<int> res(n);
  vector<int> rid(m);
  vector<int> visitor(m);
  int res_index = 0;
  int rid_index = 0;
  for (int i = 0; i < n + m; i++) {
    int x;
    cin >> x;
    if (x == 1) {
      rid[rid_index] = vec[i];
      rid_index++;
    }
    if (x == 0) {
      res[res_index] = vec[i];
      res_index++;
    }
  }
  int a = 0;
  int b = 0;
  int index = 0;
  for (int i = 0; i < res.size(); i++) {
    int x = res[i];
    int r = 0;
    bool find = false;
    for (int j = index; j < rid.size(); j++) {
      if (rid[j] > x) {
        r = j;
        find = true;
        break;
      }
    }
    if (find == false) {
      visitor[m - 1] += n;
      break;
    } else {
      if (r == 0) {
        visitor[r]++;
        n--;
      } else {
        index = r;
        a = rid[r];
        b = rid[r - 1];
        int la = abs(x - a);
        int lb = abs(x - b);
        if (la >= lb) visitor[r - 1]++;
        if (lb > la) visitor[r]++;
        n--;
      }
    }
  }
  for (int i = 0; i < m; i++) {
    cout << visitor[i] << " ";
  }
}
