// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



typedef long long ll;

const ll maxn = 100010;

ll n,q,top,tn;

ll a[maxn],S[maxn],tong[maxn],ci[maxn],sum[maxn];

vector <pair<ll,ll> >V[maxn];



ll find(ll x)

{

    ll l = 1,r = top,res = 1;

    while (l <= r)

    {

        ll mid = (l + r) >> 1;

        if (S[mid] <= x)

        {

            res = mid;

            l = mid + 1;

        }

        else

            r = mid - 1;

    }

    return res;

}



int main()

{

    scanf("%lld%lld",&n,&q);

    tn = n;

    for (ll i = 1; i <= q; i++)

        scanf("%lld",&a[i]);

    S[++top] = n;

    for (ll i = 1; i <= q; i++)

    {

        while (top && S[top] >= a[i])

            top--;

        S[++top] = a[i];

    }

    n = S[1];

    V[1].push_back(make_pair(-n,1));

    for (ll i = 2; i <= top; i++)

    {

        ll x = S[i];

        ll cur = i - 1;

        while (x > n)

        {

            ll temp = x / S[cur];

            V[i].push_back(make_pair(cur,temp));

            x %= S[cur];

            cur = find(x);

        }

        if (x > 0 && x <= n)

            V[i].push_back(make_pair(-x,1));

    }

    ci[top] = 1;

    for (ll i = top; i >= 1; i--)

        for (ll j = 0; j < V[i].size(); j++)

        {

            ll u = V[i][j].first,v = V[i][j].second;

            if (u < 0)

                tong[-u] += v * ci[i];

            else

                ci[u] += v * ci[i];

        }

    for (ll i = 1; i <= n; i++)

        if (tong[i])

        {

            sum[1] += tong[i];

            sum[i + 1] -= tong[i];

        }

    for (ll i = 1; i <= n; i++)

        sum[i] += sum[i - 1];

    for (ll i = 1; i <= n; i++)

        printf("%lld\n",sum[i]);

    for (ll i = n + 1; i <= tn; i++)

        puts("0");



    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

#define int long long

#define maxn (100010)

int n, m, top, s[maxn], cnt[maxn], sum[maxn];



inline int read() {

	int x = 0, f = 1;

	char ch = getchar();

	while (ch < '0' || ch > '9')

		ch == '-' ? f = -1, ch = getchar() : ch = getchar();

	while (ch >= '0' && ch <= '9')

		x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();

	return x * f;

}



void sol(int x, int del) {

//	printf("X %lld %lld\n", x, del);

	if (!x) return;

	int pos = upper_bound(s + 1, s + top + 1, x) - s - 1; // 找到比他大的，然后-1 

//	printf("POS %lld\n", pos);

	if (!pos) sum[1] += del, sum[x + 1] -= del;

	else cnt[pos] += (x / s[pos]) * del, sol(x % s[pos], del);

}



signed main() {

	n = read(), m = read();

	s[++top] = n;

	int x;

	for (int i = 1; i <= m; ++i) {

		x = read();

		while (top && s[top] >= x) --top;

		s[++top] = x;

	}

	cnt[top] = 1;

	for (int i = top; i >= 2; --i) {

		cnt[i - 1] += (s[i] / s[i - 1]) * cnt[i];

//		printf("	%lld %lld %lld\n", s[i] % s[i - 1], cnt[i], i);

		sol(s[i] % s[i - 1], cnt[i]);

	}

//	for (int i = 1; i <= top; ++i) printf("%lld\n", cnt[i]);

	sum[1] += cnt[1], sum[s[1] + 1] -= cnt[1]; // s[1]为最长长度

	for (int i = 1; i <= n; ++i) sum[i] += sum[i - 1];

	for (int i = 1; i <= n; ++i) printf("%lld\n", sum[i]); 

	return 0;

}


// Fastest known solution for this problem: