#include <bits/stdc++.h>
using namespace std;

const int Maxn = 100005;
int n, q, ct;
long long A[Maxn], cnt[Maxn], f[Maxn];
void work(long long len, long long w)
{
	int pos = upper_bound(A + 1, A + 1 + ct, len) - A - 1;
	if (!pos) cnt[1] += w, cnt[len + 1] -= w;
	else f[pos] += len / A[pos] * w, work(len % A[pos], w);
}
int main()
{
	scanf("%d%d", &n, &q);
	A[++ct] = n;
	while (q--)
	{
		long long x;
		scanf("%lld", &x);
		while (ct && x <= A[ct]) ct--;
		A[++ct] = x;
	}
	f[ct] = 1;
	for (int i = ct - 1; i >= 1; i--)
		f[i] += A[i + 1] / A[i] * f[i + 1], work(A[i + 1] % A[i], f[i + 1]);
	cnt[1] += f[1], cnt[A[1] + 1] -= f[1];
	for (int i = 1; i <= n; i++)
		printf("%lld\n", cnt[i]), cnt[i + 1] += cnt[i];
	return 0;
}