//STARTCOPY
#ifndef _MSC_VER
#include<bits/stdc++.h>
#else
#include <iostream>
#include<algorithm>
#include<vector>
#include <set>
#include <functional>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <queue>
#include <istream>
#include <numeric>
#include <string>
#endif

using namespace std;

using unsigned_int = unsigned int;
using need_int = int;
using counter_type = int;
using MAIN = int;
#define int DontUseIntÉ
using ll = long long;

template<typename T>
using PairOf = pair<T,T>;

using Void = tuple<>;

namespace mytl{

template<typename T, typename R, typename F=function<R(T)> >
vector<R> fmap(F f, const vector<T>& t){
    vector<R> res;
    for(auto elem : t) res.push_back(f(elem));
    return res;
}

template<typename T>
vector<T> forrange(T n, T from){
    vector<T> res(n);
    iota(res.begin(), res.end(), from);
    return res;
}

template<typename F>
void repeat(need_int n, const F& callback){
    for(need_int _ : forrange(n,0)) callback();
}

#define WATCH(x) cout << (#x) << " is " << (x) << endl
}
namespace mytl{

template<typename T>
T discrete_binary_search(bool(*f)(T), T l, T r){
    if(!f(l)) return l;
    while(l < r){
        T pivot = (l+r+1)/2;
        if(!f(pivot)) r = pivot-1;
		else l = pivot;
    }
    return l;
}

template<typename T>
T continuous_binary_search(bool(*f)(T), T l, T r, need_int iterations){
    mytl::repeat(iterations,[&](){
        T pivot = (l+r)/2;
        if(f(pivot)) l = pivot;
        else r = pivot;
    });
    return l;
}
}
namespace mytl{

template<typename T>
struct LazyVector : vector<T> {
	inline typename vector<T>::reference operator[](need_int i) {

		if (i >= vector<T>::size()) vector<T>::resize(i + 1);
		return vector<T>::operator[](i);
	}
};

template<typename T>
struct optional {
	T *ptr = nullptr;

	inline void set(const T& val) {
		ptr = new T(val);
	}

	inline optional() {}
	inline optional(const T& val) {
		set(val);
	}

	optional& operator=(const T& val){
		set(val);
		return *this;
	}

	~optional() {
		delete ptr;
	}
	inline T value() const {
		return *ptr;
	}
	inline bool has_value() const {
		return ptr != nullptr;
	}

	optional& operator=(const optional& other) {
		if (other.has_value()) {
			set(other.value());
		}
		else {
			ptr = nullptr;
		}
		return *this;
	}
	optional(const optional& other) {
		operator=(other);
	}

	optional(optional&& other) {
		ptr = other.ptr;
		other.ptr = nullptr;
	}

	optional& operator=(optional&& other) {
		if (this != &other) {
			delete ptr;
			ptr = other.ptr;
			other.ptr = nullptr;
			return *this;
		}
	}

};

}
namespace mytl{

template<typename BaseTrie>
struct Corasick {

	struct Corasick_Op : BaseTrie::Op {
		using T = typename BaseTrie::Op::T;

		template<typename N>
		struct Info {
			N* next_leaf_d = nullptr;
			N* link_d = nullptr;
			typename BaseTrie::Op::template Next<N*> go_d;
		};
	};

	using MyTrie = Trie<Corasick_Op>;
	using Node = typename MyTrie::Node;
	using T = typename Corasick_Op::T;

	MyTrie trie;

	static Node* go(Node *node, T c) {
		if (!node->go_d.contains(c)) {
			if (node->next.contains(c)) {
				node->go_d[c] = node->next[c];
			}
			else if (node->parent == nullptr) {
				node->go_d[c] = node;
			}
			else {
				node->go_d[c] = go(link(node), c);
			}
		}
		return node->go_d[c];
	};

	static Node* link(Node *node) {
		if (node->link_d == nullptr) {
			if (node->parent == nullptr) {
				node->link_d = node;
			}
			else if (node->parent->parent == nullptr) {
				node->link_d = node->parent;
			}
			else {
				node->link_d = go(link(node->parent), node->last);
			}
		}
		return node->link_d;
	}

	static Node* next_leaf(Node *node) {
		if (node->next_leaf_d == nullptr) {
			if (node->parent == nullptr) {
				node->next_leaf_d = node;
			}
			else {
				if (link(node)->leaf) {
					node->next_leaf_d = link(node);
				}
				else {
					node->next_leaf_d = next_leaf(link(node));
					if (!node->next_leaf_d->leaf) {
						node->next_leaf_d = node;
					}
				}
			}
		}
		return node->next_leaf_d;
	}

	static vector<need_int> current_matches(Node* node) {
		vector<need_int> res;
		if (node->leaf) res.push_back(node->leaf);
		while (next_leaf(node) != node) {
			node = next_leaf(node);
			res.push_back(node->leaf);
		}
		return res;
	}

	Node *root = trie.root;

	template<typename C>
	Corasick(C dictionary) {
		need_int i = 0;
		for (auto word : dictionary) {
			trie.insert_word(word, ++i);
		}
	}

};

}
namespace mytl{

struct Point{
    ll x, y;

    Point(ll x, ll y) : x{x}, y{y} {};
    Point(pair<ll,ll> initPair) : x{initPair.first}, y{initPair.second} {};

    pair<ll,ll> getPair(){//not introducing type cast operator for safety
        return {x,y};
    }

    //Unary operators
    Point operator-() const{
        return {-x, -y};
    }
    Point operator+() const{
        return {x,y};
    }

    static ll sgn(ll x){
        return (x > 0) - (x < 0);
    }

    //Binary operators on ordinary numbers
    Point operator*(const ll& operand) const{
        return {x*operand, y*operand};
    }

    //Binary operators on Point itself
    Point operator+(const Point& operand) const{
        return {x+operand.x, y+operand.y};
    }
    Point operator-(const Point& operand) const{
        return {x-operand.x, y-operand.y};
    }

    ll operator*(const Point& operand){ //vectorial product
        return x*operand.y - y*operand.x;
    }

    ll direction(const Point& a, const Point& b) const{
        return sgn((a - *this) * (b - *this));
    };
};

ll distance_squared(const Point& a, const Point& b){
    return (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

double distance(const Point& a, const Point& b){
    return sqrt(distance_squared(a, b));
}

ll cartesian_distance(const Point& a, const Point& b){
    return abs(a.x - b.x) + abs(a.y - b.y);
}

typedef vector<Point> Poly;

bool inside(const Poly& poly, const Point& point, bool strict){ //assuming Poly is weakly convex
    ll prevdir = -2;
    for(ll i=0; i<poly.size(); i++){
        ll nexdindex = (i+1)%poly.size();
        ll dir = poly[i].direction(poly[nexdindex], point);
        if(dir == 0){
            if(strict) return false;
        }
        else{
            if(dir != prevdir && prevdir != -2) return false;
            prevdir = dir;
        }

    }
    return true;
}

}
namespace mytl {

template<class T>
struct Resetter;

template<class T>
Resetter<T>* global_resetter = new Resetter<T>;

template<class T>
struct Resetter {

    using State = pair<counter_type, T>;

    State* state = new State{0, T()};

    Resetter(){}
    Resetter(T value){
        state = new State{0, value};
    }

    void activate(){
        global_resetter<T> = this;
    }

    void reset(T value){
        *state = State{state->first+1, value};
    }

    struct Variable{

        State state;
        State& parent = *global_resetter<T>->state;

        Variable() : state{*global_resetter<T>->state} {}
        Variable(T value) : state{global_resetter<T>->state->first, value} {}
        Variable(State st) : state{st} {}
        Variable(T value, State& parent) : state{parent->first, value} {};

        bool fresh(){
            return state.first >= parent.first;
        }

        void overwrite(){
            state = parent;
        }

        void refresh(){
            if(!fresh()) overwrite();
        }

        T get(){
            refresh();
            return state.second;
        }

        void survive(){
            state.first = parent.first;
        }

        void operator=(T new_value){
            state.second = new_value;
            survive();
        }

    };

};
}

namespace std{

istream& operator>>(istream& is, Void& x){
    return is;
}

template<typename P, typename Q>
istream& operator>>(istream& is, pair<P,Q> x){
    return is>>x.first>>x.second;
}

template<typename P, typename Q>
ostream& operator<<(ostream& os, const pair<P,Q>& x){
    os<<"("<<x.first<<", "<<x.second<<")";
    return os;
}

}

namespace mytl{

template<typename T, typename P=T>
T read(istream& is=cin){
    P a;
    is>>a;
    return T(a);
}

template<typename T, typename P, typename Q>
T read(istream& is=cin){
    P a;
    Q b;
    is>>a>>b;
    return T(a,b);
}

template<typename T, typename P, typename Q, typename R>
T read(istream& is=cin){
    P a;
    Q b;
    R c;
    is>>a>>b>>c;
    return T(a,b,c);
}

template<typename T, typename... Q, typename Container=vector<T>>
vector<T> readValues(ll n, istream& is=cin){
    vector<T> res;
    repeat(n, [&res](){
        res.push_back(read<T,Q...>());
    });
    return Container(res.begin(), res.end());
}

}

namespace mytl{

template<typename T>
void print(const T& x, ostream& os=cout){
    os<<x;
}

}
namespace mytl{
template<typename T>
T power(T base, ll exponential, T unit=1){
    T res = unit;
    while(exponential > 0){
        if(exponential%2 == 1) res = res * base;
        base = base * base;
        exponential = exponential / 2;
    }
    return res;
}
}
namespace mytl{
    struct Modulo{
        static ll global_mod;
    private:
        ll val;
    public:
        const ll MOD;
        Modulo(ll initMOD, ll initVal) : MOD{initMOD}, val{initVal} {
            val %= MOD;
            if(val < 0) val += MOD;
        };
        Modulo() : Modulo(global_mod, 0) {};

        static Modulo inverse(Modulo x){// asserting MOD is prime
            return power(x, x.MOD-2, x.unit());
        };
        Modulo unit() const{
            return Modulo(MOD, 1);
        }
        Modulo& operator=(const Modulo& operand){
            val = operand.val;
            return *this;
        };

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
            return val;
        }

        //Unary operators
        Modulo operator-() const{
            return Modulo(MOD, -val);
        };
        Modulo operator+() const{
            return Modulo(MOD, +val);
        };

        //Binary operators on ordinary numbers
        Modulo operator-(const ll& operand) const{
            return Modulo(MOD, val-operand);
        };
        Modulo operator+(const ll& operand) const{
            return Modulo(MOD, val+operand);
        };
        Modulo operator*(const ll& operand) const{
            return Modulo(MOD, val*operand);
        };
        Modulo operator/(const ll& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(Modulo(MOD, operand)).get());
        };

        //Binary operators on Modulo
        Modulo operator-(const Modulo& operand) const{
            return Modulo(MOD, val-operand.get());
        };
        Modulo operator+(const Modulo& operand) const{
            return Modulo(MOD, val+operand.get());
        };
        Modulo operator*(const Modulo& operand) const{
            return Modulo(MOD, val*operand.get());
        };
        Modulo operator/(const Modulo& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(operand).get());
        };

    };

    ll Modulo::global_mod = 1000000007LL;

    Modulo mod107(ll x){
        return Modulo(1000000007LL, x);
    }
    ostream& operator<<(ostream& os, Modulo x){
        return os<<"("<<x.get()<<"%"<<x.MOD<<")";
    }

}
namespace mytl{
    template<ll MOD>
    struct TSModulo{
    private:
        ll val;

    public:
        static TSModulo inverse(TSModulo x){// assuming MOD is prime and x != 0
            return power(x, MOD-2);
        };
		TSModulo(ll initVal) {
			if (-MOD < initVal && initVal < MOD) {
				val = initVal;
			}
			else {
				val = initVal % MOD;
			}
		}
        TSModulo() : TSModulo(0) {}
        TSModulo& operator=(const TSModulo&) = default;

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
			if (val >= 0) return val;
			else return val + MOD;
        }

        //Unary operators
        TSModulo operator-() const{
            return TSModulo(-val);
        };
        TSModulo operator+() const{
            return TSModulo(+val);
        };

        //Binary operators on ordinary numbers
        TSModulo operator-(const ll& operand) const{
            return TSModulo(val-operand);
        };
        TSModulo operator+(const ll& operand) const{
            return TSModulo(val+operand);
        };
        TSModulo operator*(const ll& operand) const{
            return TSModulo(val*operand);
        };
        TSModulo operator/(const ll& operand) const{ //asserting MOD is prime
            return TSModulo(inverse(operand) * val);
        };

        //Binary operators on Modulo
        TSModulo operator-(const TSModulo& operand) const{
            return TSModulo(val-operand.get());
        };
        TSModulo operator+(const TSModulo& operand) const{
            return TSModulo(val+operand.get());
        };
        TSModulo operator*(const TSModulo& operand) const{
            return TSModulo(val*operand.get());
        };
        TSModulo operator/(const TSModulo& operand) const{ //asserting MOD is prime
            return TSModulo(val * inverse(operand));
        };
    };

	template<ll MOD>
	struct optional<TSModulo<MOD> >{
		ll val = off_value;
		static const ll off_value = -MOD - 1;

		bool has_value() const {
			return val != off_value;
		}

		void set(const TSModulo<MOD>& other) {
			val = other.val;
		}

		TSModulo<MOD> value() const { //unsafe, won't tell!
			assert((has_value()));
			return TSModulo<MOD>(val);
		}

		optional() {
		}

		optional<TSModulo<MOD> >& operator=(const TSModulo<MOD>& other) {
			set(other);
			return *this;
		}
		optional(const TSModulo<MOD>& other) {
			set(other);
		}

	};

    using Mod107 = TSModulo<1000000007LL>;

    template<ll MOD>
    ostream& operator<<(ostream& os, TSModulo<MOD> x){
        return os<<"("<<x.get()<<"%"<<MOD<<")";
    }

}
namespace mytl {

template <typename C, typename Arg, typename R>
function<R(Arg)> __memoize(R(*fn)(Arg)) {
	C table;
	return [fn, table](Arg arg) mutable -> R {
		if (!table[arg].has_value()) {
			table[arg].set(fn(arg));
		}
		return table[arg].value();
	};
}

template<template<typename, typename, typename...> typename C, typename Arg, typename R>
function<R(Arg)> memoize(R(*fn)(Arg)) {
	return __memoize<C<Arg, optional<R> >, Arg, R>(fn);
}

template<typename R>
function<R (ll) > quick_memoize(R(*fn)(ll)) {
	return __memoize<LazyVector<optional<R> >, ll, R>(fn);
}

template<typename R>
function<R(ll, ll)> quick_memoize(R(*fn)(ll, ll)) {
	LazyVector< LazyVector<optional<R> > > table;
	return [fn, table](ll p1, ll p2) mutable -> R {
		if(!table[p1][p2].has_value()){
			table[p1][p2].set(fn(p1, p2));
		}
		return table[p1][p2].value();
	};
}

}
namespace mytl{
template<class Op>
struct IntervalTree : Op::Range {
	using Range = typename Op::Range;
	using T = typename Op::T;
	using Change = typename Op::Change;
	using Range::singleton;
	using Range::inside;
	using Range::intersect;
	using Range::leftHalf;
	using Range::rightHalf;

	IntervalTree *left_child = NULL, *right_child = NULL;

	T partial;
	Change pending = Op::identity();

	IntervalTree(Range range) : Range(range), partial{ Op::initial(range) } {};

	T query(Range range, Change change) {
		return query_(range, change).first;
	}

	void add(Change change) {
		pending = Op::push(pending, change);
	}

	void prepare() {
		if (!singleton()) {
			if (left_child == NULL) left_child = (new IntervalTree(leftHalf()));
			if (right_child == NULL) right_child = (new IntervalTree(rightHalf()));
			left_child->add(pending);
			right_child->add(pending);
		}
		partial = Op::apply(*this, partial, pending);
		pending = Op::identity();
	}

	pair<T, T> query_(Range range, Change change) {
		//cout<<range<<" "<<*this<<endl;
		prepare();
		if (inside(range)) {
			add(change);
			prepare();
			return { partial, Op::zero() };
		}
		if (!intersect(range)) {
			//cout<<"n"<<range<<" "<<*this<<endl;
			return { Op::zero(), partial };
		}

		auto from_left = left_child->query_(range, change);
		auto from_right = right_child->query_(range, change);
		//cout<<from_right.first<<endl;
		auto needed = Op::reduce(from_left.first, from_right.first), rest = Op::reduce(from_left.second, from_right.second);
		partial = Op::reduce(needed, rest);
		return { needed, rest };
	}

	T build_from(const function<T(ll)>& getter) {
		prepare();
		pending = Op::identity();
		if (singleton()) partial = getter(this->l);
		else partial = Op::reduce(left_child->build_from(getter), right_child->build_from(getter));
		return partial;
	}

};

template<typename Op>
class SegmentTree {
public:
	const pair<ll, ll> range;
private:
	vector<typename Op::T> t;
	vector<typename Op::Change> d;
	ll n;
	ll h;

	void __calc(ll p, ll k) {
		t[p] = Op::apply(k, Op::reduce(t[p * 2], t[p * 2 + 1]), d[p]);
	}

	void __apply(ll p, typename Op::Change value, ll k) {
		t[p] = Op::apply(k, t[p], value);
		if (p < n) d[p] = Op::push(d[p], value);
	}

	void __build(ll l, ll r) {
		ll k = 2;
		l += n;
		r += n - 1;
		for (; l > 1; k *= 2) {
			l /= 2;
			r /= 2;
			for (ll i = r; i >= l; i--) __calc(i, k);
		}
	}

	void __push(ll l, ll r) {
		ll s = h;
		ll k = 1 << (h - 1);

		l += n;
		r += n - 1;
		for (; s > 0; s--, k /= 2) {
			for (ll i = l >> s; i <= r >> s; i++) {
				__apply(i * 2, d[i], k);
				__apply(i * 2 + 1, d[i], k);
				d[i] = Op::identity();
			}
		}
	}

	void __modify(ll l, ll r, typename Op::Change value) {
		__push(l, l + 1);
		__push(r - 1, r);
		ll l0 = l, r0 = r, k = 1;

		l += n;
		r += n;
		for (; l < r; l /= 2, r /= 2, k *= 2) {
			if (l & 1) __apply(l++, value, l);
			if (r & 1) __apply(--r, value, k);
		}
		__build(l0, l0 + 1);
		__build(r0 - 1, r0);
	}

	typename Op::T __query(ll l, ll r) {
		__push(l, l + 1);
		__push(r - 1, r);
		typename Op::T resl = Op::zero(), resr = Op::zero();

		l += n;
		r += n;

		for (; l < r; l /= 2, r /= 2) {
			if (l & 1)  resl = Op::reduce(resl, t[l++]);
			if (r & 1) resr = Op::reduce(t[--r], resr);
		}
		return Op::reduce(resl, resr);

	}

public:

	SegmentTree(pair<ll, ll> range, const function<typename Op::T(ll)>& getter) : range{ range } {
		n = range.second - range.first + 1;
		t.resize(n * 2);
		d.resize(n, Op::identity());
		for (ll i = 0; i < n; i++) {
			t[i + n] = getter(i);
		}
		for (ll i = n - 1; i > 0; i--) t[i] = t[i * 2] + t[i * 2 + 1];
		h = 0;
		ll new_n = n;
		while (new_n > 0) {
			h++;
			new_n /= 2;
		}

	}

	typename Op::T query(pair<ll, ll> query_range) {
		return __query(query_range.first - range.first, query_range.second - range.first + 1);
	}
	void modify(pair<ll, ll> modify_range, typename Op::Change value) {
		__modify(modify_range.first - range.first, modify_range.second - range.first + 1, value);
	}

};

template<typename T_, typename Range_>
struct Add_Sum {
	using Range = Range_;
	using T = T_;
	using Change = T_;

	static Change identity() {
		return 0;
	}

	static T zero() {
		return 0;
	}

	static T initial(Range r) {
		return zero();
	}

	static T reduce(T a, T b) {
		return a + b;
	}

	static T apply(Range r, T a, Change c) {
		return a + r.span()*c;
	}

	static Change push(Change a, Change b) {
		return a + b;
	}
};

template<typename T_, typename Range_>
struct Multiply_Sum {
	using Range = Range_;
	using T = T_;
	using Change = T_;

	static Change identity() {
		return 1;
	}

	static T zero() {
		return 0;
	}

	static T initial(Range r) {
		return r.span() * 1;
	}

	static T reduce(T a, T b) {
		return a + b;
	}

	static T apply(Range r, T a, Change c) {
		return a * c;
	}

	static Change push(Change a, Change b) {
		return a * b;
	}
};

/*
struct Custom_Op{
using Range = _;
using T = _;
using Change = _;

static Change identity(){
return _;
}

static T zero(){
return _;
}

static T initial(Range r){
return _;
}

static T reduce(T a, T b){
return _;
}

static T apply(Range r, T a, Change c){
return _;
}

static Change push(Change a, Change b){
return _;
}

};
*/
}
namespace mytl{

template<typename T, T(*f)(T,T)>
struct Tracker : optional<T>{

	void update(const T& x){
		if (optional<T>::has_value()) {
			optional<T>::set(f(optional<T>::value(), x));
		}
		else {
			optional<T>::set(x);
		}
    }
};

template<typename T>
T min(T a, T b){return std::min(a,b);}
template<typename T>
T max(T a, T b){return std::max(a,b);}
template<typename T>
T __gcd(T a, T b){return std::__gcd(a,b);}

}
namespace mytl{

template<typename Op_>
struct Trie {
	struct Node;
	using Op = Op_;
	using T = typename Op::T;
	using Info = typename Op::template Info<Node>;
	using Next_Container = typename Op::template Next<Node*>;

	struct Node : Info {
		Node *parent;
		T last;
		Next_Container next;
		need_int leaf = 0;
		Node *jump(T c) {
			if (next.contains(c)) {
				return next[c];
			}
			else return nullptr;
		}

		Node(Node *parent, T last) : parent{ parent }, last{ last } {}
	};

	Node *root = new Node(nullptr, T());

	template<typename C>
	Node *insert_word(C word, need_int leaf_flag = 1) {
		Node *curr = root;
		for (T c : word) {
			if (!curr->next.contains(c)) {
				curr->next[c] = new Node(curr, c);
			}
			curr = curr->next[c];
		}
		curr->leaf = leaf_flag;
		return curr;
	}

	template<typename C>
	Node* jump_path(Node* node, C path) {
		for (T c : path) {
			if (node == nullptr) return node;
			node = node->jump(c);
		}
		return node;
	}

	template<typename C>
	bool contains_word(C word) {
		Node *res = jump_path(root, word);
		return res && res->leaf;
	}

};

template<need_int ALPHABETSIZE>
struct Basic_Char_Trie_Op {
	using T = char;

	template<typename Node>
	struct Info {
	};

	template<typename N>
	struct Next {
		N next[ALPHABETSIZE] = {};

		N& operator[](char i) {
			return next[i - 'a'];
		}

		bool contains(char i) {
			return operator[](i) != nullptr;
		}

	};

};

template<need_int ALPHABET_SIZE>
using CharTrie = Trie<Basic_Char_Trie_Op<ALPHABET_SIZE> >;

}
//ENDCOPY

ll n,m;

MAIN main(){
    cin>>n>>m;
    auto coords = mytl::readValues<ll>(n+m);
    auto is_taxi = mytl::readValues<ll>(n+m);
    vector<ll> taxi_drivers, people;
    for(ll i : mytl::forrange((ll)n+m, 0LL)){
        if(is_taxi[i]) taxi_drivers.push_back(coords[i]);
        else people.push_back(coords[i]);
    }

    ll current_closest = 0;
    vector<ll> points(m);
    for(ll person : people){
        while(current_closest+1 < taxi_drivers.size() && abs(person - taxi_drivers[current_closest]) > abs(person - taxi_drivers[current_closest+1])) current_closest++;
        points[current_closest]++;
    }
    for(auto elem : points){
        cout<<elem<<" ";
    }

}


//STARTCOPY
#ifndef _MSC_VER
#include<bits/stdc++.h>
#else
#include <iostream>
#include<algorithm>
#include<vector>
#include <set>
#include <functional>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <queue>
#include <istream>
#include <numeric>
#endif

using namespace std;

using unsigned_int = unsigned int;
using need_int = int;
using counter_type = int;
using MAIN = int;
#define int DontUseIntÉ
using ll = long long;

template<typename T>
using PairOf = pair<T,T>;

using Void = tuple<>;

namespace mytl{

template<typename T, typename R, typename F=function<R(T)> >
vector<R> fmap(F f, const vector<T>& t){
    vector<R> res;
    for(auto elem : t) res.push_back(f(elem));
    return res;
}

template<typename T>
vector<T> forrange(T n, T from){
    vector<T> res(n);
    iota(res.begin(), res.end(), from);
    return res;
}

template<typename F>
void repeat(need_int n, const F& callback){
    for(need_int _ : forrange(n,0)) callback();
}

#define WATCH(x) cout << (#x) << " is " << (x) << endl
}
namespace mytl{

template<typename T>
T discrete_binary_search(bool(*f)(T), T l, T r){
    if(!f(l)) return l;
    while(l < r){
        T pivot = (l+r+1)/2;
        if(!f(pivot)) r = pivot-1;
		else l = pivot;
    }
    return l;
}

template<typename T>
T continuous_binary_search(bool(*f)(T), T l, T r, need_int iterations){
    mytl::repeat(iterations,[&](){
        T pivot = (l+r)/2;
        if(f(pivot)) l = pivot;
        else r = pivot;
    });
    return l;
}
}
namespace mytl{

template<typename T>
struct LazyVector : vector<T> {
	inline typename vector<T>::reference operator[](need_int i) {
		if (i >= vector<T>::size()) vector<T>::resize(i + 1);
		return vector<T>::operator[](i);
	}
};

template<typename T>
struct optional {
	T *ptr = nullptr;

	inline optional() {}
	inline optional(T val) {
		*ptr = val;
	}

	~optional() {
		if (ptr != nullptr) delete ptr;
	}
	inline T value() {
		return *ptr;
	}
	inline bool has_value() {
		return ptr != nullptr;
	}

	inline void set(T val) {
		ptr = new T;
		*ptr = val;
	}

};

}
namespace mytl{

struct Point{
    ll x, y;

    Point(ll x, ll y) : x{x}, y{y} {};
    Point(pair<ll,ll> initPair) : x{initPair.first}, y{initPair.second} {};

    pair<ll,ll> getPair(){//not introducing type cast operator for safety
        return {x,y};
    }

    //Unary operators
    Point operator-() const{
        return {-x, -y};
    }
    Point operator+() const{
        return {x,y};
    }

    static ll sgn(ll x){
        return (x > 0) - (x < 0);
    }

    //Binary operators on ordinary numbers
    Point operator*(const ll& operand) const{
        return {x*operand, y*operand};
    }

    //Binary operators on Point itself
    Point operator+(const Point& operand) const{
        return {x+operand.x, y+operand.y};
    }
    Point operator-(const Point& operand) const{
        return {x-operand.x, y-operand.y};
    }

    ll operator*(const Point& operand){ //vectorial product
        return x*operand.y - y*operand.x;
    }

    ll direction(const Point& a, const Point& b) const{
        return sgn((a - *this) * (b - *this));
    };
};

ll distance_squared(const Point& a, const Point& b){
    return (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

double distance(const Point& a, const Point& b){
    return sqrt(distance_squared(a, b));
}

ll cartesian_distance(const Point& a, const Point& b){
    return abs(a.x - b.x) + abs(a.y - b.y);
}

typedef vector<Point> Poly;

bool inside(const Poly& poly, const Point& point, bool strict){ //assuming Poly is weakly convex
    ll prevdir = -2;
    for(ll i=0; i<poly.size(); i++){
        ll nexdindex = (i+1)%poly.size();
        ll dir = poly[i].direction(poly[nexdindex], point);
        if(dir == 0){
            if(strict) return false;
        }
        else{
            if(dir != prevdir && prevdir != -2) return false;
            prevdir = dir;
        }

    }
    return true;
}

}
namespace mytl {

template<class T>
struct Resetter;

template<class T>
Resetter<T>* global_resetter = new Resetter<T>;

template<class T>
struct Resetter {

    using State = pair<counter_type, T>;

    State* state = new State{0, T()};

    Resetter(){}
    Resetter(T value){
        state = new State{0, value};
    }

    void activate(){
        global_resetter<T> = this;
    }

    void reset(T value){
        *state = State{state->first+1, value};
    }

    struct Variable{

        State state;
        State& parent = *global_resetter<T>->state;

        Variable() : state{*global_resetter<T>->state} {}
        Variable(T value) : state{global_resetter<T>->state->first, value} {}
        Variable(State st) : state{st} {}
        Variable(T value, State& parent) : state{parent->first, value} {};

        bool fresh(){
            return state.first >= parent.first;
        }

        void overwrite(){
            state = parent;
        }

        void refresh(){
            if(!fresh()) overwrite();
        }

        T get(){
            refresh();
            return state.second;
        }

        void survive(){
            state.first = parent.first;
        }

        void operator=(T new_value){
            state.second = new_value;
            survive();
        }

    };

};
}

namespace std{

istream& operator>>(istream& is, Void& x){
    return is;
}

template<typename P, typename Q>
istream& operator>>(istream& is, pair<P,Q> x){
    return is>>x.first>>x.second;
}

template<typename P, typename Q>
ostream& operator<<(ostream& os, const pair<P,Q>& x){
    os<<"("<<x.first<<", "<<x.second<<")";
    return os;
}

template<typename T, template<typename, typename...> typename Container>
ostream& operator<<(ostream& os, const Container<T>& x){
    os<<"{";
    bool first = true;
    for(const auto& elem : x){
        if(!first) os<<", ";
        os<<elem;
        first = false;
    }
    os<<"}";
    return os;
}

}

namespace mytl{

template<typename T, typename P=T>
T read(istream& is=cin){
    P a;
    is>>a;
    return T(a);
}

template<typename T, typename P, typename Q>
T read(istream& is=cin){
    P a;
    Q b;
    is>>a>>b;
    return T(a,b);
}

template<typename T, typename P, typename Q, typename R>
T read(istream& is=cin){
    P a;
    Q b;
    R c;
    is>>a>>b>>c;
    return T(a,b,c);
}

template<typename T, typename... Q, typename Container=vector<T>>
vector<T> readValues(ll n, istream& is=cin){
    vector<T> res;
    repeat(n, [&res](){
        res.push_back(read<T,Q...>());
    });
    return Container(res.begin(), res.end());
}

}

namespace mytl{

template<typename T>
void print(const T& x, ostream& os=cout){
    os<<x;
}

}
namespace mytl{
template<typename T>
T power(T base, ll exponential, T unit=1){
    T res = unit;
    while(exponential > 0){
        if(exponential%2 == 1) res = res * base;
        base = base * base;
        exponential = exponential / 2;
    }
    return res;
}
}
namespace mytl{
    struct Modulo{
        static ll global_mod;
    private:
        ll val;
    public:
        const ll MOD;
        Modulo(ll initMOD, ll initVal) : MOD{initMOD}, val{initVal} {
            val %= MOD;
            if(val < 0) val += MOD;
        };
        Modulo() : Modulo(global_mod, 0) {};

        static Modulo inverse(Modulo x){// asserting MOD is prime
            return power(x, x.MOD-2, x.unit());
        };
        Modulo unit() const{
            return Modulo(MOD, 1);
        }
        Modulo& operator=(const Modulo& operand){
            val = operand.val;
            return *this;
        };

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
            return val;
        }

        //Unary operators
        Modulo operator-() const{
            return Modulo(MOD, -val);
        };
        Modulo operator+() const{
            return Modulo(MOD, +val);
        };

        //Binary operators on ordinary numbers
        Modulo operator-(const ll& operand) const{
            return Modulo(MOD, val-operand);
        };
        Modulo operator+(const ll& operand) const{
            return Modulo(MOD, val+operand);
        };
        Modulo operator*(const ll& operand) const{
            return Modulo(MOD, val*operand);
        };
        Modulo operator/(const ll& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(Modulo(MOD, operand)).get());
        };

        //Binary operators on Modulo
        Modulo operator-(const Modulo& operand) const{
            return Modulo(MOD, val-operand.get());
        };
        Modulo operator+(const Modulo& operand) const{
            return Modulo(MOD, val+operand.get());
        };
        Modulo operator*(const Modulo& operand) const{
            return Modulo(MOD, val*operand.get());
        };
        Modulo operator/(const Modulo& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(operand).get());
        };

    };

    ll Modulo::global_mod = 1000000007LL;

    Modulo mod107(ll x){
        return Modulo(1000000007LL, x);
    }
    ostream& operator<<(ostream& os, Modulo x){
        return os<<"("<<x.get()<<"%"<<x.MOD<<")";
    }

}
namespace mytl{
    template<ll MOD>
    struct TSModulo{
    private:
        ll val;

    public:
        static TSModulo inverse(TSModulo x){// assuming MOD is prime and x != 0
            return power(x, MOD-2);
        };
		TSModulo(ll initVal) {
			if (-MOD < initVal && initVal < MOD) {
				val = initVal;
			}
			else {
				val = initVal % MOD;
			}
		}
        TSModulo() : TSModulo(0) {}
        TSModulo& operator=(const TSModulo&) = default;

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
			if (val >= 0) return val;
			else return val + MOD;
        }

        //Unary operators
        TSModulo operator-() const{
            return TSModulo(-val);
        };
        TSModulo operator+() const{
            return TSModulo(+val);
        };

        //Binary operators on ordinary numbers
        TSModulo operator-(const ll& operand) const{
            return TSModulo(val-operand);
        };
        TSModulo operator+(const ll& operand) const{
            return TSModulo(val+operand);
        };
        TSModulo operator*(const ll& operand) const{
            return TSModulo(val*operand);
        };
        TSModulo operator/(const ll& operand) const{ //asserting MOD is prime
            return TSModulo(inverse(operand) * val);
        };

        //Binary operators on Modulo
        TSModulo operator-(const TSModulo& operand) const{
            return TSModulo(val-operand.get());
        };
        TSModulo operator+(const TSModulo& operand) const{
            return TSModulo(val+operand.get());
        };
        TSModulo operator*(const TSModulo& operand) const{
            return TSModulo(val*operand.get());
        };
        TSModulo operator/(const TSModulo& operand) const{ //asserting MOD is prime
            return TSModulo(val * inverse(operand));
        };
    };

    using Mod107 = TSModulo<1000000007LL>;

    template<ll MOD>
    ostream& operator<<(ostream& os, TSModulo<MOD> x){
        return os<<"("<<x.get()<<"%"<<MOD<<")";
    }

}
namespace mytl {

template <typename C, typename Arg, typename R>
function<R(Arg)> __memoize(R(*fn)(Arg)) {
	C table;
	return [fn, table](Arg arg) mutable -> R {
		optional<R>& res = table[arg];
		if (!res.has_value()) {
			res.set(fn(arg));
		}
		return res.value();
	};
}

template<template<typename, typename, typename...> typename C, typename Arg, typename R>
function<R(Arg)> memoize(R(*fn)(Arg)) {
	return __memoize<C<Arg, optional<R> >, Arg, R>(fn);
}

template<typename R>
function<R (ll) > quick_memoize(R(*fn)(ll)) {
	return __memoize<LazyVector<optional<R> >, ll, R>(fn);
}

template<typename R>
function<R(ll, ll)> quick_memoize(R(*fn)(ll, ll)) {
	LazyVector< LazyVector<optional<R> > > table;
	return [fn, table](ll p1, ll p2) mutable -> R {
		optional<R>& res = table[p1][p2];
		if (!res.has_value()) {
			res.set(fn(p1, p2));
		}
		return res.value();
	};
}

}
namespace mytl{
/*template<class Op>
struct Node : Op::Range{
    using Range = typename Op::Range;
    using T = typename Op::T;
    using Change = typename Op::Change;
    using Range::singleton;
    using Range::inside;
    using Range::intersect;
    using Range::leftHalf;
    using Range::rightHalf;

    Node *left_child=NULL, *right_child=NULL;

    T partial;
    Change pending = Op::identity();

    Node(Range range) : Range(range), partial{Op::initial(range)} {};

    T query(Range range, Change change){
        return query_(range, change).first;
    }

    void add(Change change){
        pending = Op::push(pending, change);
    }

    void prepare(){
        if(!singleton()){
            if(left_child == NULL) left_child = (new Node(leftHalf()));
            if(right_child == NULL) right_child = (new Node(rightHalf()));
            left_child->add(pending);
            right_child->add(pending);
        }
        partial = Op::apply(*this, partial, pending);
        pending = Op::identity();
    }

    pair<T,T> query_(Range range, Change change){
        //cout<<range<<" "<<*this<<endl;
        prepare();
        if(inside(range)){
            add(change);
            prepare();
            return {partial, Op::zero()};
        }
        if(!intersect(range)){
            //cout<<"n"<<range<<" "<<*this<<endl;
            return {Op::zero(), partial};
        }

        auto from_left = left_child->query_(range, change);
        auto from_right = right_child->query_(range, change);
        //cout<<from_right.first<<endl;
        auto needed = Op::reduce(from_left.first, from_right.first), rest = Op::reduce(from_left.second, from_right.second);
        partial = Op::reduce(needed, rest);
        return {needed, rest};
    }

    T build_from(const function<T(ll)>& getter){
        prepare();
        pending = Op::identity();
        if(singleton()) partial = getter(this->l);
        else partial = Op::reduce(left_child->build_from(getter), right_child->build_from(getter));
        return partial;
    }

};*/

template<class Op>
struct ArraySegTree {
	using Range = typename Op::Range;
	using T = typename Op::T;
	using Change = typename Op::Change;
	using Range::singleton;
	using Range::inside;
	using Range::intersect;
	using Range::leftHalf;
	using Range::rightHalf;

	struct Node {
		ll node;
		Range range;
		Node(ll node, Range range) : node{ node }, range{ range } {};

		Node left_child() {
			return Node(node * 2 + 1, range.left_half());
		}
		Node right_child() {
			return Node(node * 2 + 2, range.right_half());
		}

		T& partial(ArraySegTree *par) {
			return par->partial[node];
		}

		T& pending(ArraySegTree *par) {
			return par->pending[node];
		}

		bool leaf() {
			return range.singleton();
		}

	};

	vector<T> partial;
	vector<Change> pending;
	Node root;

	ll left_child(ll node) {
		return node * 2 + 1;
	}
	ll right_child(ll node) {
		return node * 2 + 2;
	}

	T build_from(Node node, T(*getter)(ll)) {
		if (current_range.singleton()) {
			node.partial(this) = getter(current_range.l);
		}
		else {
			node.partial(this) = Op::reduce(node.left_child(), getter), build_from(node.right_child(), getter);
		}
		node.pending(this) = Op::identity();
		return node.partial(this);
	}

	ArraySegTree(Range range, T(*getter)(ll)) {
		this->root = Node(0, range);
		partial = vector<T>(range.span() * 4, Op::zero());
		pending = vector<Change>(range*span() * 4, Op::identity());
		build_from(root, getter);
	}

	void add(Node node, Change change) {
		node.pending(this) = Op::push(node.pending(this), change);
	}

	void prepare(Node node) {
		if (!node.leaf()) {
			add(node.left_child(), node.pending(this));
		}
		node.partial(this) = Op::apply(node.partial(this), node.pending(this));
		node.pending(this) = Op::identity();
	}

	pair<T, T> query_(Node node, Range range, Change change) {
		//cout<<range<<" "<<*this<<endl;
		prepare(node);
		if (node.range.inside(range)) {
			add(node, change);
			prepare();
			return { partial, Op::zero() };
		}
		if (!node.range.intersect(range)) {
			//cout<<"n"<<range<<" "<<*this<<endl;
			return { Op::zero(), partial };
		}

		auto from_left = query_(node.left_child());
		auto from_right = query_(node.right_child());
		//cout<<from_right.first<<endl;
		auto needed = Op::reduce(from_left.first, from_right.first), rest = Op::reduce(from_left.second, from_right.second);
		node.partial(this) = Op::reduce(needed, rest);
		return { needed, rest };
	}

	T query(Range range, Change change) {
		return query_(range, change).first;
	}

};

struct Range1D{

    ll l, r;

    Range1D(ll l, ll r): l{l}, r{r} {}

    ll span() const {
        return r-l+1;
    }
    bool singleton() const {
        return span() == 1;
    }
    Range1D leftHalf() const {
        return Range1D(l, (l+r)/2);
    }
    Range1D rightHalf() const {
        return Range1D((l + r)/2 + 1, r);
    }
    bool inside(const Range1D& other) const {
        return other.l <= l && r <= other.r;
    }
    bool intersect(const Range1D& other) const {

        return other.inside(*this)
             ||(other.l <= l && l <= other.r)
             ||(other.l <= r && r <= other.r);
    }
};

}

namespace mytl{
template<typename T_>
struct Add_Sum{
    using Range = Range1D;
    using T = T_;
    using Change = T_;

    static Change identity(){
        return 0;
    }

    static T zero(){
        return 0;
    }

    static T initial(Range r){
        return zero();
    }

    static T reduce(T a, T b){
        return a + b;
    }

    static T apply(Range r, T a, Change c){
        return a + r.span()*c;
    }

    static Change push(Change a, Change b){
        return a + b;
    }
};

template<typename T_>
struct Multiply_Sum{
    using Range = Range1D;
    using T = T_;
    using Change = T_;

    static Change identity(){
        return 1;
    }

    static T zero(){
        return 0;
    }

    static T initial(Range r){
        return r.span()*1;
    }

    static T reduce(T a, T b){
        return a + b;
    }

    static T apply(Range r, T a, Change c){
        return a*c;
    }

    static Change push(Change a, Change b){
        return a*b;
    }
};

}

namespace mytl{
/*
struct Custom_Op{
    using Range = _;
    using T = _;
    using Change = _;

    static Change identity(){
        return _;
    }

    static T zero(){
        return _;
    }

    static T initial(Range r){
        return _;
    }

    static T reduce(T a, T b){
        return _;
    }

    static T apply(Range r, T a, Change c){
        return _;
    }

    static Change push(Change a, Change b){
        return _;
    }

};
*/

}
namespace mytl{

template<typename T, T(*f)(T,T)>
struct Tracker {

	T* val = nullptr;

    void update(T x){
        if(val != nullptr){
            *val = f(*val, x);
        }
        else{
			val = new T;
			*val = x;
        }
    }

	T value() {
		return *val;
	}
};

template<typename T>
T min(T a, T b){return std::min(a,b);}
template<typename T>
T max(T a, T b){return std::max(a,b);}
template<typename T>
T __gcd(T a, T b){return std::__gcd(a,b);}

}
//ENDCOPY

ll n,m;

MAIN main(){
    cin>>n>>m;
    auto coords = mytl::readValues<ll>(n+m);
    auto is_taxi = mytl::readValues<ll>(n+m);
    vector<ll> taxi_drivers, people;
    for(ll i : mytl::forrange((ll)n+m, 0LL)){
        if(is_taxi[i]) taxi_drivers.push_back(coords[i]);
        else people.push_back(coords[i]);
    }

    ll current_closest = 0;
    vector<ll> points(m);
    for(ll person : people){
        while(current_closest+1 < taxi_drivers.size() && abs(person - taxi_drivers[current_closest]) > abs(person - taxi_drivers[current_closest+1])) current_closest++;
        points[current_closest]++;
    }
    for(auto elem : points){
        cout<<elem<<" ";
    }

}


//STARTCOPY
#ifndef _MSC_VER
#include<bits/stdc++.h>
#else
#include <iostream>
#include<algorithm>
#include<vector>
#include <set>
#include <functional>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <queue>
#include <istream>
#include <numeric>
#endif

using namespace std;

using unsigned_int = unsigned int;
using need_int = int;
using counter_type = int;
using MAIN = int;
#define int DontUseIntÉ
using ll = long long;

template<typename T>
using PairOf = pair<T,T>;

using Void = tuple<>;

namespace mytl{

template<typename T, typename R, typename F=function<R(T)> >
vector<R> fmap(F f, const vector<T>& t){
    vector<R> res;
    for(auto elem : t) res.push_back(f(elem));
    return res;
}

template<typename T>
vector<T> forrange(T n, T from){
    vector<T> res(n);
    iota(res.begin(), res.end(), from);
    return res;
}

template<typename F>
void repeat(need_int n, const F& callback){
    for(need_int _ : forrange(n,0)) callback();
}

#define WATCH(x) cout << (#x) << " is " << (x) << endl
}
namespace mytl{

template<typename T>
T discrete_binary_search(bool(*f)(T), T l, T r){
    if(!f(l)) return l;
    while(l < r){
        T pivot = (l+r+1)/2;
        if(!f(pivot)) r = pivot-1;
		else l = pivot;
    }
    return l;
}

template<typename T>
T continuous_binary_search(bool(*f)(T), T l, T r, need_int iterations){
    mytl::repeat(iterations,[&](){
        T pivot = (l+r)/2;
        if(f(pivot)) l = pivot;
        else r = pivot;
    });
    return l;
}
}
namespace mytl{

template<typename T>
struct LazyVector : vector<T> {
	inline typename vector<T>::reference operator[](need_int i) {
		if (i >= vector<T>::size()) vector<T>::resize(i + 1);
		return vector<T>::operator[](i);
	}
};

template<typename T>
struct optional {
	T *ptr = nullptr;

	inline optional() {}
	inline optional(T val) {
		*ptr = val;
	}

	~optional() {
		if (ptr != nullptr) delete ptr;
	}
	inline T value() {
		return *ptr;
	}
	inline bool has_value() {
		return ptr != nullptr;
	}

	inline void set(T val) {
		ptr = new T;
		*ptr = val;
	}

};

}
namespace mytl{

struct Point{
    ll x, y;

    Point(ll x, ll y) : x{x}, y{y} {};
    Point(pair<ll,ll> initPair) : x{initPair.first}, y{initPair.second} {};

    pair<ll,ll> getPair(){//not introducing type cast operator for safety
        return {x,y};
    }

    //Unary operators
    Point operator-() const{
        return {-x, -y};
    }
    Point operator+() const{
        return {x,y};
    }

    static ll sgn(ll x){
        return (x > 0) - (x < 0);
    }

    //Binary operators on ordinary numbers
    Point operator*(const ll& operand) const{
        return {x*operand, y*operand};
    }

    //Binary operators on Point itself
    Point operator+(const Point& operand) const{
        return {x+operand.x, y+operand.y};
    }
    Point operator-(const Point& operand) const{
        return {x-operand.x, y-operand.y};
    }

    ll operator*(const Point& operand){ //vectorial product
        return x*operand.y - y*operand.x;
    }

    ll direction(const Point& a, const Point& b) const{
        return sgn((a - *this) * (b - *this));
    };
};

ll distance_squared(const Point& a, const Point& b){
    return (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

double distance(const Point& a, const Point& b){
    return sqrt(distance_squared(a, b));
}

ll cartesian_distance(const Point& a, const Point& b){
    return abs(a.x - b.x) + abs(a.y - b.y);
}

typedef vector<Point> Poly;

bool inside(const Poly& poly, const Point& point, bool strict){ //assuming Poly is weakly convex
    ll prevdir = -2;
    for(ll i=0; i<poly.size(); i++){
        ll nexdindex = (i+1)%poly.size();
        ll dir = poly[i].direction(poly[nexdindex], point);
        if(dir == 0){
            if(strict) return false;
        }
        else{
            if(dir != prevdir && prevdir != -2) return false;
            prevdir = dir;
        }

    }
    return true;
}

}
namespace mytl {

template<class T>
struct Resetter;

template<class T>
Resetter<T>* global_resetter = new Resetter<T>;

template<class T>
struct Resetter {

    using State = pair<counter_type, T>;

    State* state = new State{0, T()};

    Resetter(){}
    Resetter(T value){
        state = new State{0, value};
    }

    void activate(){
        global_resetter<T> = this;
    }

    void reset(T value){
        *state = State{state->first+1, value};
    }

    struct Variable{

        State state;
        State& parent = *global_resetter<T>->state;

        Variable() : state{*global_resetter<T>->state} {}
        Variable(T value) : state{global_resetter<T>->state->first, value} {}
        Variable(State st) : state{st} {}
        Variable(T value, State& parent) : state{parent->first, value} {};

        bool fresh(){
            return state.first >= parent.first;
        }

        void overwrite(){
            state = parent;
        }

        void refresh(){
            if(!fresh()) overwrite();
        }

        T get(){
            refresh();
            return state.second;
        }

        void survive(){
            state.first = parent.first;
        }

        void operator=(T new_value){
            state.second = new_value;
            survive();
        }

    };

};
}

namespace std{

istream& operator>>(istream& is, Void& x){
    return is;
}

template<typename P, typename Q>
istream& operator>>(istream& is, pair<P,Q> x){
    return is>>x.first>>x.second;
}

template<typename P, typename Q>
ostream& operator<<(ostream& os, const pair<P,Q>& x){
    os<<"("<<x.first<<", "<<x.second<<")";
    return os;
}

template<typename T, template<typename, typename...> typename Container>
ostream& operator<<(ostream& os, const Container<T>& x){
    os<<"{";
    bool first = true;
    for(const auto& elem : x){
        if(!first) os<<", ";
        os<<elem;
        first = false;
    }
    os<<"}";
    return os;
}

}

namespace mytl{

template<typename T, typename P=T>
T read(istream& is=cin){
    P a;
    is>>a;
    return T(a);
}

template<typename T, typename P, typename Q>
T read(istream& is=cin){
    P a;
    Q b;
    is>>a>>b;
    return T(a,b);
}

template<typename T, typename P, typename Q, typename R>
T read(istream& is=cin){
    P a;
    Q b;
    R c;
    is>>a>>b>>c;
    return T(a,b,c);
}

template<typename T, typename... Q, typename Container=vector<T>>
vector<T> readValues(ll n, istream& is=cin){
    vector<T> res;
    repeat(n, [&res](){
        res.push_back(read<T,Q...>());
    });
    return Container(res.begin(), res.end());
}

}

namespace mytl{

template<typename T>
void print(const T& x, ostream& os=cout){
    os<<x;
}

}
namespace mytl{
template<typename T>
T power(T base, ll exponential, T unit=1){
    T res = unit;
    while(exponential > 0){
        if(exponential%2 == 1) res = res * base;
        base = base * base;
        exponential = exponential / 2;
    }
    return res;
}
}
namespace mytl{
    struct Modulo{
        static ll global_mod;
    private:
        ll val;
    public:
        const ll MOD;
        Modulo(ll initMOD, ll initVal) : MOD{initMOD}, val{initVal} {
            val %= MOD;
            if(val < 0) val += MOD;
        };
        Modulo() : Modulo(global_mod, 0) {};

        static Modulo inverse(Modulo x){// asserting MOD is prime
            return power(x, x.MOD-2, x.unit());
        };
        Modulo unit() const{
            return Modulo(MOD, 1);
        }
        Modulo& operator=(const Modulo& operand){
            val = operand.val;
            return *this;
        };

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
            return val;
        }

        //Unary operators
        Modulo operator-() const{
            return Modulo(MOD, -val);
        };
        Modulo operator+() const{
            return Modulo(MOD, +val);
        };

        //Binary operators on ordinary numbers
        Modulo operator-(const ll& operand) const{
            return Modulo(MOD, val-operand);
        };
        Modulo operator+(const ll& operand) const{
            return Modulo(MOD, val+operand);
        };
        Modulo operator*(const ll& operand) const{
            return Modulo(MOD, val*operand);
        };
        Modulo operator/(const ll& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(Modulo(MOD, operand)).get());
        };

        //Binary operators on Modulo
        Modulo operator-(const Modulo& operand) const{
            return Modulo(MOD, val-operand.get());
        };
        Modulo operator+(const Modulo& operand) const{
            return Modulo(MOD, val+operand.get());
        };
        Modulo operator*(const Modulo& operand) const{
            return Modulo(MOD, val*operand.get());
        };
        Modulo operator/(const Modulo& operand) const{ //asserting MOD is prime
            return Modulo(MOD, val * inverse(operand).get());
        };

    };

    ll Modulo::global_mod = 1000000007LL;

    Modulo mod107(ll x){
        return Modulo(1000000007LL, x);
    }
    ostream& operator<<(ostream& os, Modulo x){
        return os<<"("<<x.get()<<"%"<<x.MOD<<")";
    }

}
namespace mytl{
    template<ll MOD>
    struct TSModulo{
    private:
        ll val;

    public:
        static TSModulo inverse(TSModulo x){// assuming MOD is prime and x != 0
            return power(x, MOD-2);
        };
		TSModulo(ll initVal) {
			if (-MOD < initVal && initVal < MOD) {
				val = initVal;
			}
			else {
				val = initVal % MOD;
			}
		}
        TSModulo() : TSModulo(0) {}
        TSModulo& operator=(const TSModulo&) = default;

        ll get() const{ // no type cast operator to prevent accidentally turning into ordinary number
			if (val >= 0) return val;
			else return val + MOD;
        }

        //Unary operators
        TSModulo operator-() const{
            return TSModulo(-val);
        };
        TSModulo operator+() const{
            return TSModulo(+val);
        };

        //Binary operators on ordinary numbers
        TSModulo operator-(const ll& operand) const{
            return TSModulo(val-operand);
        };
        TSModulo operator+(const ll& operand) const{
            return TSModulo(val+operand);
        };
        TSModulo operator*(const ll& operand) const{
            return TSModulo(val*operand);
        };
        TSModulo operator/(const ll& operand) const{ //asserting MOD is prime
            return TSModulo(inverse(operand) * val);
        };

        //Binary operators on Modulo
        TSModulo operator-(const TSModulo& operand) const{
            return TSModulo(val-operand.get());
        };
        TSModulo operator+(const TSModulo& operand) const{
            return TSModulo(val+operand.get());
        };
        TSModulo operator*(const TSModulo& operand) const{
            return TSModulo(val*operand.get());
        };
        TSModulo operator/(const TSModulo& operand) const{ //asserting MOD is prime
            return TSModulo(val * inverse(operand));
        };
    };

    using Mod107 = TSModulo<1000000007LL>;

    template<ll MOD>
    ostream& operator<<(ostream& os, TSModulo<MOD> x){
        return os<<"("<<x.get()<<"%"<<MOD<<")";
    }

}
namespace mytl {

template <typename C, typename Arg, typename R>
function<R(Arg)> __memoize(R(*fn)(Arg)) {
	C table;
	return [fn, table](Arg arg) mutable -> R {
		optional<R>& res = table[arg];
		if (!res.has_value()) {
			res.set(fn(arg));
		}
		return res.value();
	};
}

template<template<typename, typename, typename...> typename C, typename Arg, typename R>
function<R(Arg)> memoize(R(*fn)(Arg)) {
	return __memoize<C<Arg, optional<R> >, Arg, R>(fn);
}

template<typename R>
function<R (ll) > quick_memoize(R(*fn)(ll)) {
	return __memoize<LazyVector<optional<R> >, ll, R>(fn);
}

template<typename R>
function<R(ll, ll)> quick_memoize(R(*fn)(ll, ll)) {
	LazyVector< LazyVector<optional<R> > > table;
	return [fn, table](ll p1, ll p2) mutable -> R {
		optional<R>& res = table[p1][p2];
		if (!res.has_value()) {
			res.set(fn(p1, p2));
		}
		return res.value();
	};
}

}
namespace mytl{
template<class Op>
struct IntervalTree : Op::Range {
	using Range = typename Op::Range;
	using T = typename Op::T;
	using Change = typename Op::Change;
	using Range::singleton;
	using Range::inside;
	using Range::intersect;
	using Range::leftHalf;
	using Range::rightHalf;

	IntervalTree *left_child = NULL, *right_child = NULL;

	T partial;
	Change pending = Op::identity();

	IntervalTree(Range range) : Range(range), partial{ Op::initial(range) } {};

	T query(Range range, Change change) {
		return query_(range, change).first;
	}

	void add(Change change) {
		pending = Op::push(pending, change);
	}

	void prepare() {
		if (!singleton()) {
			if (left_child == NULL) left_child = (new IntervalTree(leftHalf()));
			if (right_child == NULL) right_child = (new IntervalTree(rightHalf()));
			left_child->add(pending);
			right_child->add(pending);
		}
		partial = Op::apply(*this, partial, pending);
		pending = Op::identity();
	}

	pair<T, T> query_(Range range, Change change) {
		//cout<<range<<" "<<*this<<endl;
		prepare();
		if (inside(range)) {
			add(change);
			prepare();
			return { partial, Op::zero() };
		}
		if (!intersect(range)) {
			//cout<<"n"<<range<<" "<<*this<<endl;
			return { Op::zero(), partial };
		}

		auto from_left = left_child->query_(range, change);
		auto from_right = right_child->query_(range, change);
		//cout<<from_right.first<<endl;
		auto needed = Op::reduce(from_left.first, from_right.first), rest = Op::reduce(from_left.second, from_right.second);
		partial = Op::reduce(needed, rest);
		return { needed, rest };
	}

	T build_from(const function<T(ll)>& getter) {
		prepare();
		pending = Op::identity();
		if (singleton()) partial = getter(this->l);
		else partial = Op::reduce(left_child->build_from(getter), right_child->build_from(getter));
		return partial;
	}

};

template<typename Op>
class SegmentTree {
public:
	const pair<ll, ll> range;
private:
	vector<typename Op::T> t;
	vector<typename Op::Change> d;
	ll n;
	ll h;

	void __calc(ll p, ll k) {
		t[p] = Op::apply(k, Op::reduce(t[p * 2], t[p * 2 + 1]), d[p]);
	}

	void __apply(ll p, typename Op::Change value, ll k) {
		t[p] = Op::apply(k, t[p], value);
		if (p < n) d[p] = Op::push(d[p], value);
	}

	void __build(ll l, ll r) {
		ll k = 2;
		l += n;
		r += n - 1;
		for (; l > 1; k *= 2) {
			l /= 2;
			r /= 2;
			for (ll i = r; i >= l; i--) __calc(i, k);
		}
	}

	void __push(ll l, ll r) {
		ll s = h;
		ll k = 1 << (h - 1);

		l += n;
		r += n - 1;
		for (; s > 0; s--, k /= 2) {
			for (ll i = l >> s; i <= r >> s; i++) {
				__apply(i * 2, d[i], k);
				__apply(i * 2 + 1, d[i], k);
				d[i] = Op::identity();
			}
		}
	}

	void __modify(ll l, ll r, typename Op::Change value) {
		__push(l, l + 1);
		__push(r - 1, r);
		ll l0 = l, r0 = r, k = 1;

		l += n;
		r += n;
		for (; l < r; l /= 2, r /= 2, k *= 2) {
			if (l & 1) __apply(l++, value, l);
			if (r & 1) __apply(--r, value, k);
		}
		__build(l0, l0 + 1);
		__build(r0 - 1, r0);
	}

	typename Op::T __query(ll l, ll r) {
		__push(l, l + 1);
		__push(r - 1, r);
		typename Op::T resl = Op::zero(), resr = Op::zero();

		l += n;
		r += n;

		for (; l < r; l /= 2, r /= 2) {
			if (l & 1)  resl = Op::reduce(resl, t[l++]);
			if (r & 1) resr = Op::reduce(t[--r], resr);
		}
		return Op::reduce(resl, resr);

	}

public:

	SegmentTree(pair<ll, ll> range, const function<typename Op::T(ll)>& getter) : range{ range } {
		n = range.second - range.first + 1;
		t.resize(n * 2);
		d.resize(n, Op::identity());
		for (ll i = 0; i < n; i++) {
			t[i + n] = getter(i);
		}
		for (ll i = n - 1; i > 0; i--) t[i] = t[i * 2] + t[i * 2 + 1];
		h = 0;
		ll new_n = n;
		while (new_n > 0) {
			h++;
			new_n /= 2;
		}

	}

	typename Op::T query(pair<ll, ll> query_range) {
		return __query(query_range.first - range.first, query_range.second - range.first + 1);
	}
	void modify(pair<ll, ll> modify_range, typename Op::Change value) {
		__modify(modify_range.first - range.first, modify_range.second - range.first + 1, value);
	}

};

template<typename T_, typename Range_>
struct Add_Sum {
	using Range = Range_;
	using T = T_;
	using Change = T_;

	static Change identity() {
		return 0;
	}

	static T zero() {
		return 0;
	}

	static T initial(Range r) {
		return zero();
	}

	static T reduce(T a, T b) {
		return a + b;
	}

	static T apply(Range r, T a, Change c) {
		return a + r.span()*c;
	}

	static Change push(Change a, Change b) {
		return a + b;
	}
};

template<typename T_, typename Range_>
struct Multiply_Sum {
	using Range = Range_;
	using T = T_;
	using Change = T_;

	static Change identity() {
		return 1;
	}

	static T zero() {
		return 0;
	}

	static T initial(Range r) {
		return r.span() * 1;
	}

	static T reduce(T a, T b) {
		return a + b;
	}

	static T apply(Range r, T a, Change c) {
		return a * c;
	}

	static Change push(Change a, Change b) {
		return a * b;
	}
};

/*
struct Custom_Op{
using Range = _;
using T = _;
using Change = _;

static Change identity(){
return _;
}

static T zero(){
return _;
}

static T initial(Range r){
return _;
}

static T reduce(T a, T b){
return _;
}

static T apply(Range r, T a, Change c){
return _;
}

static Change push(Change a, Change b){
return _;
}

};
*/
}
namespace mytl{

template<typename T, T(*f)(T,T)>
struct Tracker {

	T* val = nullptr;

    void update(T x){
        if(val != nullptr){
            *val = f(*val, x);
        }
        else{
			val = new T;
			*val = x;
        }
    }

	T value() {
		return *val;
	}
};

template<typename T>
T min(T a, T b){return std::min(a,b);}
template<typename T>
T max(T a, T b){return std::max(a,b);}
template<typename T>
T __gcd(T a, T b){return std::__gcd(a,b);}

}
//ENDCOPY

ll n,m;

MAIN main(){
    cin>>n>>m;
    auto coords = mytl::readValues<ll>(n+m);
    auto is_taxi = mytl::readValues<ll>(n+m);
    vector<ll> taxi_drivers, people;
    for(ll i : mytl::forrange((ll)n+m, 0LL)){
        if(is_taxi[i]) taxi_drivers.push_back(coords[i]);
        else people.push_back(coords[i]);
    }

    ll current_closest = 0;
    vector<ll> points(m);
    for(ll person : people){
        while(current_closest+1 < taxi_drivers.size() && abs(person - taxi_drivers[current_closest]) > abs(person - taxi_drivers[current_closest+1])) current_closest++;
        points[current_closest]++;
    }
    for(auto elem : points){
        cout<<elem<<" ";
    }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

    sort(pass.begin(),pass.end());
     sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     int j=0;
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]>taxi[j])
         j++;
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {

                     if(taxi[j]-pass[i]<pass[i]-taxi[j-1])
                     count[j]++;
                     else
                     count[j-1]++;

         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

    sort(pass.begin(),pass.end());
     sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     int j=0;
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]>taxi[j])
         j++;
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {
                   if(taxi[j]>=pass[i]&&pass[i]>=taxi[j-1])
                   {
                     if(taxi[j]-pass[i]<pass[i]-taxi[j-1])
                     count[j]++;
                     else
                     count[j-1]++;
                   }
                   else
                   continue;

         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

   // sort(pass.begin(),pass.end());
    // sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     int j=0;
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]>taxi[j])
         j++;
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {
                   if(taxi[j]>=pass[i]&&pass[i]>=taxi[j-1])
                   {
                     if((taxi[j]-pass[i])<(pass[i]-taxi[j-1]))
                     {
                     count[j]++;
                     }
                     else
                     {
                     count[j-1]++;
                     }
                   }
                   else
                   continue;

         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

   // sort(pass.begin(),pass.end());
    // sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     int j=0;
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]>taxi[j])
         j++;
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {

                     if(abs(taxi[j]-pass[i])<abs(pass[i]-taxi[j-1]))
                     {
                     count[j]++;
                     }
                     else
                     {
                     count[j-1]++;
                     }

         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

   int j=0;
   sum=0;
   for(int i=0;i<n+k;i++)
   {
       if(j<k-1&&abs(taxi[j+1]-a[i])<abs(taxi[j]-a[i]))
       {
           taxi[j]=sum;
           j++;
           sum=0;
       }
       if(j==k-1)
       {
           taxi[k-1]=n+k-i-1;
           break;
       }
       if(b[i]==0)
       {
           sum++;
       }
   }
   for(int i=0;i<k;i++)
   {
       cout<<taxi[i]<<" ";
   }
   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

    sort(pass.begin(),pass.end());
     sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {
             for(int j=1;j<taxi.size();j++)
             {
                 if(pass[i]<=taxi[j])
                 {
                     if(taxi[j]-pass[i]<pass[i]-taxi[j-1])
                     count[j]++;
                     else
                     count[j-1]++;
                 }
             }
         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n],b[n];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

    sort(pass.begin(),pass.end());
     sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {
             for(int j=1;j<taxi.size();j++)
             {
                 if(pass[i]<=taxi[j])
                 {
                     if(taxi[j]-pass[i]<pass[i]-taxi[j-1])
                     count[j]++;
                     else
                     count[j-1]++;
                 }
             }
         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//_CRT_SECURE_NO_WARNINGS
using namespace std;
#define IOS ios::sync_with_stdio(0);
#define endl "\n"
long long n, k, p1, p2, x, q, ans1, ans2, y, l, ans, m,temp;
long long  minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;

int main()
{
    q=1;
   //cin>>q;
   while(q--)
   {
     cin>>n>>k;
     int a[n+k],b[n+k];
     vector<int>pass;
     vector<int>taxi;
     for(int i=0;i<n+k;i++)
     {
          cin>>a[i];
     }
     for(int i=0;i<n+k;i++)
     {
         cin>>b[i];
         if(b[i]==0)
         pass.push_back(a[i]);
         else
         taxi.push_back(a[i]);
     }

    sort(pass.begin(),pass.end());
     sort(taxi.begin(),taxi.end());

     int count[taxi.size()]={0};
     for(int i=0;i<pass.size();i++)
     {
         if(pass[i]<=taxi[0])
         {
             count[0]++;
         }
         else if(pass[i]>taxi[taxi.size()-1])
         {
            count[taxi.size()-1]++;
         }
         else
         {
             for(int j=1;j<taxi.size();j++)
             {
                 if(pass[i]<=taxi[j])
                 {
                     if(taxi[j]-pass[i]<pass[i]-taxi[j-1])
                     count[j]++;
                     else
                     count[j-1]++;
                     break;
                 }
             }
         }
     }
     for(int i=0;i<taxi.size();i++)
     cout<<count[i]<<" ";

   }

}


#include<bits/stdc++.h>

#define ll long long
#define ull unsigned long long

#define pii pair < int, int >
#define pll pair < ll, ll >
#define pci pair < char, int >
#define psi pair < string, int >

#define vi vector < int >
#define vll vector < ll >
#define vs vector < string >
#define vc vector < char >
#define vpi vector < pii >
#define vpll vector < pll >

#define pb push_back

#define pi acos(-1)

#define fast ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

using namespace std;

const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;

int a[maxn], b[maxn], ans[maxn];

int main()
{
    fast;

    int n, m, taxi = 0;

    cin >> n >> m;

    vi pos;

    for(int i = 1; i <= n + m; i++) cin >> a[i];
    for(int i = 1; i <= n + m; i++){
        cin >> b[i];

        if(b[i] == 1) pos.pb(i), taxi++;
    }

    ans[0] = (pos[0] - 1);

    for(int i = 0; i < pos.size() - 1; i++){
        for(int j = pos[i] + 1; j < pos[i + 1]; j++){
            int dst1 = a[j] - a[pos[i]], dst2 = a[pos[i + 1]] - a[j];

            //cout << dst1 << ' ' << dst2 << endl;

            if(dst1 <= dst2) ans[i]++;
            else ans[i + 1]++;
        }
    }

    ans[taxi - 1] += (n + m - pos.back());

    for(int i = 0; i < taxi; i++) cout << ans[i] << ' ';

    cout << endl;

    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int mas[n];
    for(int i = 0; i < n; i++){
        cin >> mas[i];
        mas[i] = i - mas[i];
    }
    int bord = n, sum = 0;
    for(int i = n - 1; i >= 0; i--){
        if(i < bord) sum ++;
        if(mas[i] < bord){
            bord = mas[i];
        }
    }
    cout << sum;
    return 0;
}


// Example program
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int mas[n];
    for(int i = 0; i < n; i++){
        cin >> mas[i];
    }
    int bord = n, sum = 0;
    for(int i = n - 1; i >= 0; i--){
        if(i < bord) sum ++;
        if(mas[i] > 0 && i - mas[i] < bord){
            bord  = i - mas[i];
        }
    }
    cout << sum;
    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int mas[n], vol[n];
    for(int i = 0; i < n; i++){
        cin >> mas[i];
    }
    int bord = n, sum = 0;
    for(int i = n - 1; i >= 0; i--){
        if(i < bord) sum ++;
        if(mas[i] > 0){
            bord  = min(bord, i - mas[i]);
        }
    }
    cout << sum;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int a[1000005];
bool vis[1000005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i = 1; i <= n; i++)
        scanf("%d",&a[i]);
    int index = n;
    for(int i = n; i > 1; i--)
    {
        for(int j = i-1; j >= i-a[i] && j >= 1; j--)
        {
            if(j >= index)
                j = index;
            vis[j] = 1;
            index = j;
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(vis[i] == 0)
            ans++;
    printf("%d\n",ans);
    return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f

using namespace std;

const double eps = 1e-8;
const LL MOD = 1e9+7;
const int MAXN = 1e6 + 5;

int a[MAXN];
bool vis[MAXN];

int main()
{

    int n;
    cin >> n;
    for(int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    int index = n;
    for(int i = n; i > 1; i--)
    {
        int sum = 0;
        for(int j = n-1; sum < a[i]; j--, sum++)
        {
            if(j >= index)
            {
                int d = j - (index-1);
                j = index-1;
                sum = sum + d;
            }
            vis[j] = 1;
            index = j;
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(vis[i] == 0)
            ans++;
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int a[1000005];
bool vis[1000005];
int main()
{
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    int index = n;
    for(int i = n; i > 1; i--)
    {
        for(int j = i-1; j >= i-a[i] && j >= 1; j--)
        {
            if(j >= index)
                j = index;
            vis[j] = 1;
            index = j;
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(vis[i] == 0)
            ans++;
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f

using namespace std;

const double eps = 1e-8;
const LL MOD = 1e9+7;
const int MAXN = 1e6 + 5;

int a[MAXN];
bool vis[MAXN];

int main()
{
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    int index = n;
    for(int i = n; i > 1; i--)
    {
        int sum = 0;
        for(int j = i-1; sum < a[i]; j--, sum++)
        {
            if(index == 0)
                break;
            if(j >= index)
            {
                int d = j - (index-1);
                j = index-1;
                sum = sum + d;
            }
            vis[j] = 1;
            index = j;
            if(j == 1)
                break;
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(vis[i] == 0)
            ans++;
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f

using namespace std;

const double eps = 1e-8;
const LL MOD = 1e9+7;
const int MAXN = 1e6 + 5;

int a[MAXN];
bool vis[MAXN];

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    int n;
    cin >> n;
    for(int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    int index = n;
    for(int i = n; i > 1; i--)
    {
        int sum = 0;
        for(int j = i-1; sum < a[i]; j--, sum++)
        {
            if(j >= index)
            {
                int d = j - (index-1);
                j = index-1;
                sum = sum + d;
            }
            vis[j] = 1;
            index = j;
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(vis[i] == 0)
            ans++;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
ll a[1000000],b[1000000];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    ll sum;
    while(cin>>n)
    {
        memset(b,0,sizeof(b));
        sum=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            for(int j=i-1;j>=0&&j>=i-a[i];j--)
            {
                b[j]=1;
            }
        }
        for(int i=0;i<n;i++)
            if(!b[i])sum++;
        cout<<sum<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
ll a[1000000],b[1000000];
int main()
{
    int n;
    ll sum;
    while(cin>>n)
    {
        memset(b,0,sizeof(b));
        sum=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            for(int j=i-1;j>=0&&j>=i-a[i];j--)
            {
                b[j]=1;
            }
        }
        for(int i=0;i<n;i++)
            if(!b[i])sum++;
        cout<<sum<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
int a[1000000];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    int cur,sum;
    while(cin>>n)
    {
        sum=n;
        cur=n-1;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
        }
        while(cur>=0)
        {
            if(a[cur]>=cur)
            {
                sum-=cur;
                break;
            }
            sum-=a[cur];
            if(a[cur])
                cur-=a[cur];
            else
                cur--;
        }
        cout<<max(sum,1)<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
int a[1000000];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    int sum;
    while(cin>>n)
    {
        sum=n;
        int cur=n-1;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
        }
        while(cur>=0)
        {
            if(a[cur]>=cur)
            {
                sum-=cur;
                break;
            }
            sum-=a[cur];
            if(a[cur])
            {
                cur-=a[cur];
            }
            else
            {
                cur--;
            }
        }
        cout<<max(sum,0)<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
int a[1000000];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,sum,x,flag;
    while(cin>>n)
    {
        sum=1;
        for(int i=0;i<n;i++)cin>>a[i];
        x=a[n-1];
        flag=n-1;
        for(int i=n-2;i>=0;i--)
        {
            if(x<flag-i)
            {
                sum++;
            }
            if(a[i]>=x+i-flag)
            {
                flag=i;
                x=a[i];
            }
        }
        cout<<sum<<endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

long long n,aux;
vector<long long> v;

int main()
{
    scanf("%lld",&n);

    for(int i=0; i<n; i++)
    {
        scanf("%lld",&aux);
        v.push_back(aux);
    }

    long long cnt = n;
    long long last = n;
    for(int i=n-1; i>=0; i--)
    {
        if(i >= last)
        {
            cnt--;
        }
        last = min(last,i-v[i]);
    }

    printf("%lld",cnt);

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

long long n,aux;
vector<long long> jump;

int main()
{
    cin >> n;
    for(long long i=0; i<n; i++)
    {
        cin >> aux;
        jump.push_back(i-aux);
    }

    long long i = n-1;
    long long cnt = 0;

    while(i >= 0)
    {
        cnt++;
        i = jump[i] - 1;
    }

    cout << cnt;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int n,aux;
vector<int> v;
bool alive[1000005];

int main()
{
    cin >> n;
    for(int i=0; i<n; i++)
    {
        alive[i] = true;
        cin >> aux;
        v.push_back(aux);
    }

    int i = n-2;
    int kill = v[n-1];

    while(i >= 0)
    {
        if(kill > 0)
        {
            kill--;
            alive[i] = false;
        }

        i--;
        kill = max(kill,v[i]);
    }

    int cnt = 0;
    for(int i=0; i<n; i++)
    {
        if(alive[i])
        {
            //cout << i << endl;
            cnt++;
        }
    }
    cout << cnt;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

long long n,aux;
vector<long long> jump;

int main()
{
    cin >> n;
    for(long long i=0; i<n; i++)
    {
        cin >> aux;
        jump.push_back(i-aux);
    }

    long long i = n-1;
    long long cnt = 0;

    while(i >= 0)
    {
        cnt++;
        i = jump[i];
    }

    cout << cnt;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

long long n,aux;
vector<long long> v;
bool alive[1000005];

int main()
{
    cin >> n;
    for(long long i=0; i<n; i++)
    {
        alive[i] = true;
        cin >> aux;
        v.push_back(aux);
    }

    long long i = n-2;
    long long kill = v[n-1];

    while(i >= 0)
    {
        if(kill > 0)
        {
            kill--;
            alive[i] = false;
        }

        i--;
        kill = max(kill,v[i]);
    }

    long long cnt = 0;
    for(long long i=0; i<n; i++)
    {
        if(alive[i])
        {
            //cout << i << endl;
            cnt++;
        }
    }
    cout << cnt;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

long long n,aux;
vector<long long> v;
bool alive[1000005];

int main()
{
    cin >> n;
    for(long long i=0; i<n; i++)
    {
        alive[i] = true;
        cin >> aux;
        v.push_back(aux);
    }

    long long i = n-2;
    long long kill = v[n-1];

    while(i >= 0)
    {
        if(kill > 0)
        {
            kill--;
            alive[i] = false;
        }

        kill = max(kill,v[i]);
        i--;

    }

    long long cnt = 0;
    for(long long i=0; i<n; i++)
    {
        if(alive[i])
        {
            //cout << i << endl;
            cnt++;
        }
    }
    cout << cnt;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

long long n,aux;
vector<long long> v;
long long alive;

int main()
{
    cin >> n;
    for(long long i=0; i<n; i++)
    {
        cin >> aux;
        v.push_back(aux);
    }

    long long i = n-2;
    long long kill = v[n-1];
    alive = n;
    while(i >= 0)
    {
        if(kill > 0)
        {
            kill--;
            alive--;
        }

        kill = max(kill,v[i]);
        i--;

    }

    cout << alive;

    return 0;
}


#include <bits\stdc++.h>
using namespace std;
int n,a[1000001],mx,i,k;
int main(){
    printf("%d",&n);
    for(i=0;i<n;i++)
    printf("%d",&a[i]);
    for(i=n-1;i>=0;i--)
    {
        if (mx==0) k++;
        mx=max(b-1,a[i]);
    }
    printf("%d",k);
}


#include <iostream>
#include <cstdio>
using namespace std;
int n,a[1000001],mx,i,k;
int main(){
    scanf("%d",&n);
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(i=n-1;i>=0;i--)
    {
        if (mx==0) k++;
        mx=max(mx-1,a[i]);
    }
    printf("%d",k);
}


#include <bits\stdc++.h>
using namespace std;
int n,a[1000001],mx,i,k;
int main(){
    printf("%d",&n);
    for(i=0;i<n;i++)
    printf("%d",&a[i]);
    for(i=n-1;i>=0;i--)
    {
        if (mx==0) k++;
        mx=max(mx-1,a[i]);
    }
    printf("%d",k);
}


#include <bits\stdc++.h>
using namespace std;
int n,a[1000001],b,i,k;
int main(){
    cin>>n;
    for(i=0;i<n;i++)
    cin>>a[i];
    for(i=n-1;i>=0;i--)
    {
        if (b==0) k++;
        b=max(b-1,a[i]);
    }
    cout<<k<<endl;
}


#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;

const int inf = 0x7fffffff;
int n, L[1000000], maxx = inf, result;

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> L[i];
	}
	for (int i = n; i >= 1; i--) {
		if (i >= maxx) {
			result++;
		}
		maxx = min(maxx, i - L[i]);
	}
	cout << (n - result) << endl;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1e6 + 10;
int L[maxn];
int status[maxn];

int main(){
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++){
		cin >> L[i];
	}
	reverse(L + 1, L + 1 + n);
	memset(status, 0, sizeof(status));
	int now = L[1] + 1;
	int count = 0;
	for (int i = 2; i <= n; i++) {
		if (i <= now) {
			status[i] = 1;
		}
		now = max(now, i + L[i]);
	}
	for (int i = 1; i <= n; i++){
		if (!status[i]) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <cstring>
using namespace std;
const int inf = 0x7fffffff;

int main() {
	int n;
	cin >> n;
	int L[1000000];
	for (int i = 0; i < n; i++) {
		cin >> L[i];
	}
	int max = inf, total = 0;
	for (int i = (n - 1); i >= 0; i--) {
		if (i >= max) {
			total++;
		}
		max = min(max, i - L[i]);
	}
	cout << (n - total) << endl;
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
using namespace std;

const int maxn = (int)1e6 + 10;
int n;
int L[maxn], alive[maxn];

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	int count = n;
	for (int i = 1; i <= n; i++) {
		alive[i] = 1;
		cin >> L[i];
		int start = ((i - L[i]) < 1) ? 1 : (i - L[i]);
		for (int j = start; j < i; j++) {
			if (alive[j] == 1) {
				alive[j] = 0;
				count--;
			}
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
using namespace std;

const int maxn = (int)1e6 + 100;
int n;
int L[maxn], alive[maxn];

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		alive[i] = 1;
		cin >> L[i];
		int start = ((i - L[i]) < 1) ? 1 : (i - L[i]);
		for (int j = start; j < i; j++) {
			alive[j] = 0;
		}
	}
	int count = 0;
	for (int i = 1; i <= n; i++) {
		if (alive[i] == 1) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
#include <stdlib.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	int *L = new int[n];
	int *status = new int[n];
	int count = 0;
	for (int i = 0; i < n; i++) {
		cin >> L[i];
		status[i] = 1;
	}
	for (int i = 0; i < n; i++) {
		if ((i - L[i]) < i) {
			for (int j = (i - L[i]); j < i; j++) {
				if (status[j] == 1) {
					status[j] = 0;
				}
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (status[i] == 1) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
using namespace std;
const int maxn = 1e6 + 10;
int L[maxn];
int status[maxn];

int main() {
	int n;
	cin >> n;
	int count = n;
	for (int i = 1; i <= n; i++) {
		cin >> L[i];
		status[i] = 1;
	}
	for (int i = 1; i <= n; i++) {
		if ((i - L[i]) < i) {
			for (int j = (i - L[i]); j < i; j++) {
				if (status[j] == 1) {
					status[j] = 0;
					count--;
				}
			}
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
using namespace std;

const int maxn = 1e6 + 10;
int L[maxn];

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> L[i];
	}
	int count = 0;
	int temp = n + 1;
	for (int i = n; i >= 1; i--) {
		if (i < temp) {
			count++;
		}
		if (temp >= i - L[i]) {
			temp = i - L[i];
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
using namespace std;
const int maxn = 1e6 + 10;
int L[maxn];
int status[maxn];

int main() {
	int n;
	cin >> n;
	int count = 0;
	for (int i = 0; i < n; i++) {
		cin >> L[i];
		status[i] = 1;
	}
	for (int i = 0; i < n; i++) {
		if ((i - L[i]) < i) {
			for (int j = (i - L[i]); j < i; j++) {
				if (status[j] == 1) {
					status[j] = 0;
				}
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (status[i] == 1) {
			count = count + 1;
		}
	}
	cout << count << endl;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
const int maxn = 1e6 + 10;
int L[maxn];
int status[maxn];

int main(){
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++){
		cin >> L[i];
	}
	reverse(L + 1, L + 1 + n);
	memset(status, 0, sizeof(status));
	int now = L[1] + 1;
	int count = 0;
	for (int i = 2; i <= n; i++) {
		if (i <= now) {
			status[i] = 1;
		}
		now = max(now, i + L[i]);
	}
	for (int i = 1; i <= n; i++){
		if (!status[i]) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
using namespace std;
const int maxn = 1e6 + 10;
int L[maxn];
int status[maxn];

int main() {
	int n;
	cin >> n;
	int count = n;
	for (int i = 0; i < n; i++) {
		cin >> L[i];
		status[i] = 1;
	}
	for (int i = 0; i < n; i++) {
		if ((i - L[i]) < i) {
			for (int j = (i - L[i]); j < i; j++) {
				if (status[j] == 1) {
					status[j] = 0;
					count--;
				}
			}
		}
	}
	cout << count << endl;
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<map>
#define ll long long
using namespace std;
int a[100010];
int main()
{
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
        cin>>a[i];
    int l=n,r=n,ans=0;
    for(int j=n; j>=1; j--)
    {
        if(a[j]>0)
        {
            int x=min(a[j],j);
            l=j-x; //cout<<l<<" "<<r<<" "<<ans<<endl;
            if(l<=0)
            l=1;
            if(l<r)
                ans+=(j-l);
            r=l;

        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#define ll long long
using namespace std;
ll a[1000005];
ll b[1000005];
int main()
{
    ll n;
    scanf("%lld",&n);
    int l=0,r;
    for(ll i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    ll ans=0,R;
    for(ll i=2; i<=n; i++)
    {
        if(a[i]>0)
        {
            r=min(a[i],i-1);
            R=i-1;
            if((R-r)<l)
                ans+=(R-l);
            else
                ans+=r;

            l=R;cout<<ans<<" "<<l<<endl;
        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<map>
#define ll long long
using namespace std;
ll a[1000010];
int main()
{
    ll n;
    cin>>n;
    for(ll i=1; i<=n; i++)
        cin>>a[i];
    ll l=n,r=n,ans=0;
    for(ll j=n; j>=1; j--)
    {
        if(a[j]>0)
        {
            ll x=min(a[j],j);
            l=j-x; //cout<<l<<" "<<r<<" "<<ans<<endl;
            if(l<=0)
            l=1;
            if(l<r)
                ans+=(min(j,r)-l);
            r=l;

        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<map>
#define ll long long
using namespace std;
ll a[1000010];
int main()
{
    ll n;
   scanf("%lld",&n);
    for(ll i=1; i<=n; i++)
     scanf("%lld",&a[i]);
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    ll l=n,r=n,ans=0;
    for(ll j=n; j>=1; j--)
    {
        if(a[j]>0)
        {
            ll x=min(a[j],j);
            l=min(l,j-x);
            if(l<=0)
                l=1;
            if(l<r)
                ans+=(min(j,r)-l);
            r=l;//cout<<l<<" "<<j<<" "<<ans<<endl;

        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#define ll long long
using namespace std;
ll a[1000005];
ll b[1000005];
int main()
{
    ll n;
    scanf("%lld",&n);
    int l=0,r;
    for(ll i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    ll ans=0,R;
    for(ll i=2; i<=n; i++)
    {
        if(a[i]>0)
        {
            r=min(a[i],i-1);
            R=i-1;
            if((R-r)<l)
                ans+=(R-l);
            else
                ans+=r;

            l=R;//cout<<ans<<" "<<l<<endl;
        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{
    int n;
    scanf("%d",&n);
    int l=0,r;
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&a[i]);
    }
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    int ans=0,R;
    for(int i=2; i<=n; i++)
    {
        if(a[i]>0)
        {
            r=min(a[i],i-1);
            R=i-1;
            if((R-r)<l)
                ans+=(R-l);
            else
                ans+=r;

            l=R;//cout<<ans<<" "<<l<<endl;
        }
    }
    cout<<n-ans<<endl;
    //cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{
    int n;
    cin>>n;
    int l=0,r;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    int ans=0,R;
    for(int i=2; i<=n; i++)
    {
        if(a[i]>0)
        {
            r=min(a[i],i-1);
            R=i-1;
            if((R-r)<l)
                ans+=(R-l);
            else
                ans+=r;

            l=R;//cout<<ans<<" "<<l<<endl;
        }
    }
    cout<<n-ans<<endl;
    //cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{
    int n;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    int ans=0;
    for(int i=n-1; i>=0; i--)
    {
        int t=a[i];
        int x=i-1;
        while(t--)
        {
            b[x]=1;
            x--;
            if(x<0)
            {
                for(int i=0; i<n; i++)
                    if(b[i]==0)ans++;
                cout<<ans<<endl;
                return 0;
            }
        }
    }
    for(int i=0; i<n; i++)
        if(b[i]==0)ans++;
    cout<<ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{
    int n;
    cin>>n;
    int l=0,r;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    int ans=0,R;
    for(int i=2; i<=n; i++)
    {
        if(a[i]>0)
        {
            r=min(a[i],i-1);
            R=i-1;
            if((R-r)<l)
                ans+=(R-l);
            else
                ans+=r;

            l=R;//cout<<ans<<" "<<l<<endl;
        }

    }
    cout<<n-ans<<endl;
    //cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<map>
#define ll long long
using namespace std;
ll a[1000010];
int main()
{
    ll n;
   scanf("%lld",&n);
    for(ll i=1; i<=n; i++)
     scanf("%lld",&a[i]);
    if(a[n]>=n-1)
    {
        cout<<1<<endl;
        return 0;
    }
    ll l=n,r=n,ans=0;
    for(ll j=n; j>=1; j--)
    {
        if(a[j]>0)
        {
            ll x=min(a[j],j);
            l=j-x; //cout<<l<<" "<<r<<" "<<ans<<endl;
            if(l<=0)
                l=1;
            if(l<r)
                ans+=(min(j,r)-l);
            r=l;

        }
    }
    cout<<n-ans<<endl;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<map>
#define ll long long
using namespace std;
int a[100010];
int main()
{
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
        cin>>a[i];
    int l=n,r=n,ans=0;
    for(int j=n; j>=1; j--)
    {
        if(a[j]>0)
        {
            int x=min(a[j],j);
            l=j-x; //cout<<l<<" "<<r<<" "<<ans<<endl;
            if(l<=0)
            l=1;
            if(l<r)
                ans+=(min(j,r)-l);
            r=l;

        }
    }
    cout<<n-ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int L[1000002];
int M[1000002];
int main()
{

int n,x,y,j,cnt;
cin>>n;
if(n==1)
    cout<<1<<endl;
else{
        cnt=0;
for(int i=1;i<=n;i++)M[i]=1;

for(int i=1; i<=n; i++)cin>>L[i];

       int i=n;
        while(i>=2)
        {

            int p=0;
            j=i-1;
            while(p<L[i])
            {
                x=i-L[i];
            if(x<=j)
                M[j]=-1;

                p++;
                j--;
            }
            i--;

        }
        for(int i=1; i<=n; i++)
            if(M[i]==1)cnt++;
        cout<<cnt<<endl;
}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int L[1000002];
int M[1000002];
  int main()
   {

int n,x,y,j,t;
cin>>n;
t=n;
 for(int i=1; i<=n; i++)
 {
     scanf("%d",&L[i]);
     //M[i]=L[i];
 }

int m;
x=1;
while(!L[t])t--;
m=L[t];
  for(int i=--t;i>=1;i--)
  {
      if(L[i]==0&&m==0)
        continue;
        if(m)
            M[i]=-1;
      m=max(L[i],m-1);
      if(m>=i)
      {
          x=i;
          break;
      }
  }

  int cnt=0;
  for(int i=x; i<=n;i++)
  {
      if(M[i]==0)cnt++;
     // cout<<i<<" "<<M[i]<<" \n";
  }

    cout<<cnt<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int L[1000002];
int M[1000002];
int main()
{

int n,x,y,j,cnt;
cin>>n;
if(n==1)
    cout<<1<<endl;
else{

        cnt=0;
for(int i=1;i<=n;i++)M[i]=1;

for(int i=1; i<=n; i++)cin>>L[i];

       int i=n;
        while(i>=2)
        {

            int p=0;
            j=i-1;
            while(p<=L[i])
            {
                x=i-L[i];
            if(x<=j)
                M[j]=-1;
                p++;
                j--;
            }
            i--;

        }
        for(int i=1; i<=n; i++)
            if(M[i]==1)cnt++;
        cout<<cnt<<endl;
}

    return 0;
}