#include <bits/stdc++.h>
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
const int N = 1e5 + 7;
int n, m, x[N + N], t[N + N], d[N + N];
int a[N + N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < n + m; i++) cin >> x[i];
  for (int i = 0; i < n + m; i++) cin >> d[i];
  t[0] = d[0];
  for (int i = 1; i < n + m; i++) t[i] = d[i] + t[i - 1];
  for (int i = 0; i < n + m; i++) {
    if (d[i] == 0) {
      int l = -1;
      if (t[i] > 0) {
        l = lower_bound(t, t + i, t[i]) - t;
      }
      int r = -1;
      if (t[n + m - 1] > t[i]) {
        r = lower_bound(t + i, t + n + m, t[i] + 1) - t;
      }
      if (l != -1 && r != -1) {
        if (abs(x[l] - x[i]) <= abs(x[r] - x[i]))
          a[l]++;
        else
          a[r]++;
        continue;
      }
      if (l != -1) {
        a[l]++;
        continue;
      }
      if (r != -1) {
        a[r]++;
        continue;
      }
    }
  }
  for (int i = 0; i < n + m; i++)
    if (d[i] == 1) cout << a[i] << " ";
  cout << '\n';
  return 0;
}
