#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#define ll long long
using namespace std; 
const int N=100010;
ll n,num,m,x; 
ll a[N],f[N],s[N]; 
void solve(ll x,ll k){
	if (x<a[1]){
		s[x]+=k;
		return;
	}
	ll l=1,r=num,y;
	while (l<=r){
		ll mid=(l+r)/2;
		if (a[mid]<=x){
			y=mid;
			l=mid+1;
		}else r=mid-1;
	}
	f[y]+=k*(x/a[y]);
	x=x%a[y];
	if (x) solve(x,k);
}
int main(){
	scanf("%lld%lld",&n,&m);
	num=1;
	a[1]=n;
	for (ll i=1; i<=m; i++){
		scanf("%lld",&x);
		while (x<=a[num]&&num)
			--num;
		num++;
		a[num]=x;
	}
	f[num]=1;
	for (ll i=num-1; i>=1; i--){
		f[i]+=f[i+1]*(a[i+1]/a[i]);
		solve(a[i+1]%a[i],f[i+1]);
	}
	for (ll i=a[1]; i>=1; i--)
		s[i]+=s[i+1];
	for (ll i=1; i<=a[1]; i++)
		s[i]+=f[1];
	for (ll i=1; i<=n; i++)
		printf("%lld\n",s[i]);
	return 0;
}