#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100010
int q, n, num;
ll len[N], val[N], ans[N], x;
void search(ll x, ll v) {
    if (x == 0) return;
    int add = upper_bound(len + 1, len + num + 1, x) - len - 1;
    if (add) {
        val[add] += (x / len[add]) * v;
        search(x % len[add], v);
    } else
        ans[1] += v, ans[x + 1] -= v;
}
int main() {
    scanf("%d%d", &n, &q);
    len[++num] = n;
    while (q--) {
        scanf("%lld", &x);
        while (num && len[num] >= x) num--;
        len[++num] = x;
    }
    val[num] = 1;
    for (ll i = num - 1; i; i--) {
        val[i] += len[i + 1] / len[i] * val[i + 1];
        search(len[i + 1] % len[i], val[i + 1]);
    }
    ans[1] += val[1], ans[len[1] + 1] -= val[1];
    for (ll i = 1; i <= n; i++) printf("%lld\n", ans[i] += ans[i - 1]);
    return 0;
}