#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
ll q[N],ans[N];
int n,Q,top;
ll cnt[N];
int main(){
	scanf("%d%d",&n,&Q);
	q[++top]=n;
	for (int i=1;i<=Q;i++){
		ll x; scanf("%lld",&x);
		for (;q[top]>=x;top--);
		q[++top]=x;
	}
	cnt[top]=1;
	for (int i=top;i>1;i--){
		if (!cnt[i]) continue;
		ll tmp=q[i];
		for (;tmp>q[1];){
			int l=1,r=i-1,ans;
			while (l<=r){
				int mid=(l+r)/2;
				if (q[mid]<=tmp)
					ans=mid,l=mid+1;
				else r=mid-1;
			}
			cnt[ans]+=tmp/q[ans]*cnt[i];
			tmp%=q[ans];
		}
		ans[tmp]+=cnt[i];
	}
	ans[q[1]]+=cnt[1];
	for (int i=n;i;i--)
		ans[i]+=ans[i+1];
	for (int i=1;i<=n;i++)
		printf("%lld\n",ans[i]);
}