#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const long double eps = 1e-9;
const long long mod = 1e9 + 7;
pair<long long, long long> dir[8] = {{-1, 0}, {1, 0},   {0, -1}, {0, 1},
                                     {1, 1},  {-1, -1}, {-1, 1}, {1, -1}};
const long long nn = 2e5 + 5;
void robin() {
  long long n, m;
  cin >> n >> m;
  long long x[n + m], t[n + m];
  vector<long long> td;
  for (long long i = 0; i < n + m; i++) cin >> x[i];
  for (long long i = 0; i < n + m; i++) {
    cin >> t[i];
    if (t[i] == 1) td.push_back(x[i]);
  }
  long long sz = ((long long)(td).size());
  vector<long long> ans(sz, 0);
  long long cur = 0, nxt = 1;
  for (long long i = 0; i < n + m; i++) {
    if (t[i] == 1) continue;
    long long ind = lower_bound((td).begin(), (td).end(), x[i]) - td.begin();
    if (ind == sz)
      ans[sz - 1]++;
    else if (ind == 0)
      ans[0]++;
    else if (abs(td[ind - 1] - x[i]) <= abs(td[ind] - x[i]))
      ans[ind - 1]++;
    else
      ans[ind]++;
  }
  for (long long i = 0; i < sz; i++) cout << ans[i] << ' ';
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long T = 1;
  for (long long tc = 1; tc <= T; tc++) {
    robin();
  }
  return 0;
}
