#include<bits/stdc++.h>
#define ll long long
#define N 100009
using namespace std;

int n,m; ll a[N],q[N],tg[N];
void solve(ll x,ll y){
	if (x<q[1]){
		if (x) a[x]+=y; return;
	}
	int l=1,r=n,mid;
	while (l<r){
		mid=l+r+1>>1;
		if (q[mid]<=x) l=mid; else r=mid-1;
	}
	tg[l]+=x/q[l]*y; solve(x%q[l],y);
}
int main(){
	scanf("%lld%d",&q[n=1],&m); q[0]=q[1];
	int i; ll x;
	for (i=1; i<=m; i++){
		scanf("%lld",&x);
		while (n && x<=q[n]) n--; q[++n]=x;
	}
	for (i=n,tg[i]=1; i>1; i--){
		tg[i-1]+=q[i]/q[i-1]*tg[i];
		solve(q[i]%q[i-1],tg[i]);
	}
	a[q[1]]+=tg[1];
	for (i=q[0]; i; i--) a[i]+=a[i+1];
	for (i=1; i<=q[0]; i++) printf("%lld\n",a[i]);
	return 0;
}
