#include <bits/stdc++.h>
using namespace std;
int n,p;
double w;
priority_queue<int> l;
priority_queue<int,vector<int>,greater<int>> r;
void insert(int x) {
if(l.empty()||x<=l.top()) l.push(x);
else r.push(x);
}
int query(int k) {
while(l.size()<k) {
l.push(r.top());
r.pop();
}
while(l.size()>k) {
r.push(l.top());
l.pop();
}
return l.top();
}
signed main() {
cin >> n >> w;
w/=100.0;
for(int i=1;i<=n;++i) {
cin >> p;
insert(p);
cout << query(max(1,(int)(p*w))) << ' ';
}
return 0;
}
xx