#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> A(n + m + 2), B(n + m), C(n + m), R(n + m);
  long out_left = n + m, out_right = n + m + 1;
  A[out_left] = -2e9;
  A[out_right] = 2e9;
  for (int i = 0; i < n + m; ++i) cin >> A[i];
  for (int i = 0; i < n + m; ++i) cin >> B[i];
  C[0] = B[0];
  for (int i = 1; i < n + m; ++i) C[i] = C[i - 1] + B[i];
  for (int i = 0; i < n + m; ++i) {
    if (!B[i]) {
      long le = distance(C.begin(), lower_bound(C.begin(), C.end(), C[i]));
      long ri = distance(C.begin(), upper_bound(C.begin(), C.end(), C[i]));
      if (le == i || !B[le] || le >= n + m) le = out_left;
      if (ri == i || !B[ri] || ri >= n + m) ri = out_right;
      R[A[i] - A[le] <= A[ri] - A[i] ? le : ri]++;
    }
  }
  int fst = 0;
  for (int i = 0; i < n + m; ++i)
    if (B[i]) cout << (fst++ ? " " : "") << R[i];
}
