include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
const int N = 200010;
typedef long long LL;
LL a[N],s[N];
LL b[N],c[N],d[N];
int count1,count2;
int main()
{
int n,m;
scanf(“%d%d”, &n,&m);
for (int i = 0; i < n + m; i ){
scanf(“%d”, &a[i]);
}
for (int i = 0; i < n + m; i ) {
scanf(“%d”, &s[i]);
if(s[i] == 1ll){
c[count1] = a[i];
}
else{
b[count2] = a[i];
}
}
if(m == 1) printf(“%d”,n);
if(m >= 2){
int j1= 0,j2 = 1;
for(int i=0;i[HTML_REMOVED]c[j1]&&b[i]>c[j2]){
if(j2==count1-1){
d[j2];
}else{
j1;
j2;
i–;
}
}
else{
if(abs(b[i]-c[j1] )<=abs(b[i] -c[j2]) )
{
d[j1];
}
else
d[j2];
}
}
for(int i=0;i<count1;i)
printf(“%d “,d[i]);
}
return 0;
}