Problem: Snuke got an integer sequence from his mother, as a birthday present. The sequence has N elements, and the i-th of them is i. Snuke performs the following Q operations on this sequence. The i-th operation, described by a parameter q_i, is as follows:

* Take the first q_i elements from the sequence obtained by concatenating infinitely many copy of the current sequence, then replace the current sequence with those q_i elements.



After these Q operations, find how many times each of the integers 1 through N appears in the final sequence.

Constraints

* 1 ≦ N ≦ 10^5
* 0 ≦ Q ≦ 10^5
* 1 ≦ q_i ≦ 10^{18}
* All input values are integers.

Input

The input is given from Standard Input in the following format:


N Q
q_1
:
q_Q


Output

Print N lines. The i-th line (1 ≦ i ≦ N) should contain the number of times integer i appears in the final sequence after the Q operations.

Examples

Input

5 3
6
4
11


Output

3
3
3
2
0


Input

10 10
9
13
18
8
10
10
9
19
22
27


Output

7
4
4
3
3
2
2
2
0
0

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define ll long long
#define maxn 100005
#define inf 2e18
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define per(i,a,b) for(ll i=a;i>=b;i--)
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

ll n,q,b[maxn],cnt,c[maxn],X[maxn],ans;

inline void wk(ll x,ll y,ll z)
{
	//cout<<x<<" "<<y<<" "<<z<<endl;
	if(y<=1)
	{
		c[1]+=z; c[x+1]-=z;
		return;
	}
	ll p1=x%b[y-1],p2=x/b[y-1]; X[y-1]+=(p2*z);
	ll tmp=upper_bound(b+1,b+cnt+1,p1)-b;
	wk(p1,tmp,z);
}

int main()
{
	n=read(); q=read(); b[++cnt]=n; b[0]=-inf;
	rep(i,1,q)
	{
		ll x=read();
		while(x<=b[cnt]&&cnt!=0) cnt--; b[++cnt]=x;
	}
	X[cnt]=1;
	per(i,cnt,1) wk(b[i],i,X[i]);
	rep(i,1,n) ans+=c[i],printf("%lld\n",ans);
	return 0;
}