#include <bits/stdc++.h>

typedef long long LL;
const int N = 100005;
int n, m, top;
LL q[N], c[N], ans[N];

void solve(LL len, int id) {
	if (!len) return;
	if (len <= q[1]) ans[0] += c[id], ans[len] -= c[id];
	else {
		int t = std::upper_bound(q + 1, q + m + 1, len) - q - 1;
		c[t] += len / q[t] * c[id], solve(len % q[t], id);
	}
}
int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> m, q[top = 1] = n;
	for (int i = 1; i <= m; ++i) {
		LL x; std::cin >> x;
		while (top && q[top] >= x) --top;
		q[++top] = x;
	}
	c[m = top] = 1;
	for (int i = m - 1; i; --i)
		c[i] += q[i + 1] / q[i] * c[i + 1], solve(q[i + 1] % q[i], i + 1);
	ans[0] += c[1], ans[q[1]] -= c[1];
	for (int i = 1; i < n; ++i) ans[i] += ans[i - 1];
	for (int i = 0; i < n; ++i) std::cout << ans[i] << '\n';
	return 0;
}