#include <bits/stdc++.h>
using namespace std;
int setbit(int n, int pos) { return n = n | (1 << pos); }
int resetbit(int n, int pos) { return n = n & ~(1 << pos); }
bool checkbit(int n, int pos) { return (bool)(n & (1 << pos)); }
template <typename T>
void print(const T& v) {
  cerr << v << ' ';
}
template <typename T1, typename... T2>
void print(const T1& first, const T2&... rest) {
  print(first);
  print(rest...);
}
const int mod = 100000000;
const int M = 2001230;
const int N = 100002;
const long long inf = 9999999999999999;
pair<long long, int> _left[M + 2], _right[M + 2];
long long a[M + 2], t[M + 2], ans[M + 2];
int n, m;
vector<long long> v;
void faltu() {
  for (int i = 0; i < n + m + 1; i++) cerr << _left[i].second << ' ';
  cerr << "\n";
  for (int i = 0; i < n + m + 1; i++) cerr << _right[i].second << ' ';
  cerr << "\n";
}
pair<long long, int> f(int id) {
  long long l, r;
  l = abs(a[id] - a[_left[id].second]);
  r = abs(a[id] - a[_right[id].second]);
  if (id == 1) return _right[id];
  if (id == n + m) return _left[id];
  if (l == r) {
    if (_left[id].second < _right[id].second) return _left[id];
    return _right[id];
  }
  if (l > r) return _right[id];
  return _left[id];
}
void solve() {
  for (int i = 1; i <= n + m; i++) {
    if (t[i] == 0) {
      ans[f(i).second]++;
    }
  }
  for (int i = 1; i <= n + m; i++)
    if (t[i] == 1) printf("%d ", ans[i]);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n + m; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n + m; i++) scanf("%I64d", &t[i]);
  a[n + m + 1] = a[0] = inf;
  _left[0].second = _right[0].second = 0;
  for (int i = 1; i <= n + m; i++) {
    if (t[i] == 1) {
      _left[i].first = a[i];
      _left[i].second = i;
    } else {
      _left[i].first = a[i - 1] + _left[i - 1].first;
      _left[i].second = _left[i - 1].second;
    }
  }
  for (int i = n + m; i >= 1; i--) {
    if (t[i] == 1) {
      _right[i].first = 0;
      _right[i].second = i;
    } else {
      _right[i].first = a[i + 1] + _right[i + 1].first;
      _right[i].second = _right[i + 1].second;
    }
  }
  solve();
  return 0;
}
