#include<bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;

int n, q, siz;
long long ms[N], num[N], ans[N];

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> q;
    ms[++siz] = n;
    for (int i = 1; i <= q; i++){
        long long x; cin >> x;
        while (siz && ms[siz] >= x) siz--;
        ms[++siz] = x; 
    }
    num[siz] = 1;
    for (int i = siz; i >= 1; i--){
        long long k = ms[i];
        while (k > ms[1]){
            int pos = lower_bound(ms+1, ms+1+siz, k) - ms - 1;
            num[pos] += num[i] * (k / ms[pos]);
            k %= ms[pos];
        }
        ans[k] += num[i];
    }
    for (int i = n; i >= 1; i--) ans[i] += ans[i+1];
    for (int i = 1; i <= n; i++) cout << ans[i] << "\n";
}