#include <bits/stdc++.h>
using namespace std;
const int N=1000009;
int n,m,a[N];
struct Stick{
int len,cut;
int MaxPiece()const {
return (len%(cut+1)==0?len/(cut+1):len/(cut+1)+1);
}
int MinPiece()const {
return len/(cut+1);
}
// double E() const{
// return (double)(len)/(double)(cut);
// }
bool operator <(const Stick&other)const{
return E()<other.E();
}
};
Stick s[N];
int Minx=1e9+1;
priority_queue<Stick>pq;
int main(){
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>a[i];
Minx=min(Minx,a[i]);
pq.push((Stick){a[i],0});
}
for(int i=1;i<=m;i++){
Stick now=pq.top();
pq.pop();
now.cut++;
Minx=min(Minx,now.MinPiece());
pq.push(now);
cout<<pq.top().MaxPiece()-Minx<<" ";
// cout<<pq.top().MaxPiece()<<" "<<Minx<<endl;
}
return 0;
}