#include <cstdio>
#include <cstring>
#include <map> 
#include <vector>
#include <algorithm>

#define X first
#define Y second
#define PB push_back

using namespace std;

typedef long long ll;

const int N = 1e5 + 500;

vector < ll > q;
map < ll, ll > S;
ll sol[N];
int n, Q;

int main(){
	scanf("%d%d", &n, &Q);
	q.PB(n);
	for(int i = 0;i < Q;i++){
		ll x; scanf("%lld", &x);
		while((int)q.size() > 0 && q.back() >= x)
			q.pop_back();
		q.PB(x);
	}
	Q = (int)q.size();
	S[q[Q - 1]] = 1;
	for(int i = Q - 2;i >= 0;i--){
		while(S.rbegin() -> X > q[i]){
			S[q[i]] += S.rbegin() -> Y * (S.rbegin() -> X / q[i]);
			S[S.rbegin() -> X % q[i]] += S.rbegin() -> Y;
			S.erase(--S.end()); 
		}
	}
	for(int i = n;i >= 1;i--){
		sol[i] = sol[i + 1] + S[i];
	}
	for(int i = 1;i <= n;i++)
		printf("%lld\n", sol[i]);
	return 0;
}