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