#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define TRACE 1
#define tcout TRACE && cout
#define IN(o) insert(o)
#define fi first
#define se second
#define int long long
#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const int INF = 0x3f3f3f3f3f3f3f3f;
const int P = 998244353;
const int N = 1e6 + 10;
int n, t;
char s[N];
inline int llceil(int a)
{
if(a % 2)
{
return a / 2 + 1;
}
return a / 2;
}
queue<int> b;
signed main()
{
cin >> n >> t;
for(int i=1; i<=n; i++) cin >> s[i];
int res = 0;
for(int i=1; i<=n; i++)
{
int x;
cin >> x;
if(s[i] == '0')
{
while(!b.empty())
{
int y = (x - b.front());
if(llceil(y) <= t)
{
res += b.size();
cout << b.size() << " ";
break;
}
else b.pop();
}
}
if(s[i] == '1') b.push(x);
}
cout << res;
return 0;
}