#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k, a, r = 0, t = 0, cnt = 0, taxi = -1, m, dif;
  vector<long long> v, ans, driv;
  map<long long, long long> mp, pos, add, ma, diff;
  cin >> n >> m;
  for (i = 0; i < n + m; i++) {
    cin >> a;
    v.push_back(a);
  }
  for (i = 0; i < n + m; i++) {
    cin >> a;
    if (a == 1) {
      mp[v[i]] = 1;
      driv.push_back(i);
    }
  }
  for (i = 0; i < n + m; i++) {
    if (mp[v[i]] == 1) {
      taxi = v[i];
    }
    if (taxi != -1 && mp[v[i]] == 0) {
      add[taxi]++;
      ma[v[i]] = taxi;
      diff[v[i]] = abs(v[i] - taxi);
    }
  }
  taxi = -1;
  r = 0;
  t = 0;
  for (i = n + m - 1; i >= 0; i--) {
    if (mp[v[i]] == 1) taxi = v[i];
    if (mp[v[i]] == 0 && taxi != -1) {
      dif = abs(v[i] - taxi);
      if (diff[v[i]] == 0) {
        add[taxi]++;
      } else if (dif < diff[v[i]]) {
        add[taxi]++;
        add[ma[v[i]]]--;
      }
    }
  }
  for (i = 0; i < driv.size(); i++) cout << add[v[driv[i]]] << " ";
}
