#include <bits/stdc++.h>
using namespace std;
const int maxN = 200100;
int res[maxN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = 1;
  for (int t = 1; t <= T; ++t) {
    int n, m;
    cin >> n >> m;
    int input[n + m + 1], coordinates[n + m + 1];
    for (int i = 1; i <= n + m; ++i) {
      cin >> input[i];
    }
    vector<int> drivers;
    for (int i = 1; i <= n + m; ++i) {
      cin >> coordinates[i];
      if (coordinates[i]) {
        drivers.push_back(i);
      }
    }
    if (m == 1) {
      cout << n << "\n";
      continue;
    }
    for (int i = 0; i < m; ++i) {
      if (i == 0) {
        res[drivers[i]] += drivers[i] - 1;
        for (int j = drivers[i] + 1; j < drivers[i + 1]; ++j) {
          if (abs(input[j] - input[drivers[i]]) >
              abs(input[j] - input[drivers[i + 1]])) {
            res[drivers[i + 1]] += 1;
          } else {
            res[drivers[i]] += 1;
          }
        }
      } else {
        if (i == m - 1) {
          res[drivers[i]] += (n + m) - drivers[i];
        } else {
          for (int j = drivers[i] + 1; j < drivers[i + 1]; ++j) {
            if (abs(input[j] - input[drivers[i]]) >
                abs(input[j] - input[drivers[i + 1]])) {
              res[drivers[i + 1]] += 1;
            } else {
              res[drivers[i]] += 1;
            }
          }
        }
      }
    }
    for (int i = 1; i <= n + m; ++i) {
      if (coordinates[i]) {
        cout << res[i] << " ";
      }
    }
  }
}
