#include <cstdio>
typedef long long LL;
const int MAXN = 1e5+1;
LL A[MAXN], C[MAXN], S[MAXN];
int find(int L, int R, LL x)
{
	int mid;
	while (L < R)
	{
		mid = (L+R)>>1;
		if(A[mid] >= x)
			R = mid;
		else
			L = mid+1;
	}
	return L;
}
int main()
{
	int N, Q, i, pos, Len = 0;
	LL x;
	scanf("%d%d", &N, &Q);
	A[Len++] = N;
	for(i=0; i<Q; ++i)
	{
		scanf("%lld", &x);
		while (Len && A[Len-1]>=x) --Len;
		A[Len++] = x;
	}
	C[Len-1] = 1;
	for(i=Len-1; i>=0; --i)
	{
		x = A[i];
		while (x > A[0])
		{
			pos = find(0, Len, x)-1;
			C[pos] += C[i] * (x / A[pos]);
			x %= A[pos];
		}
		S[x] += C[i];
	}
	for(i=N-1; i>0; --i)
		S[i] += S[i+1];
	for(i=1; i<=N; ++i)
		printf("%lld\n", S[i]);
}