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 mset(a,b) memset(a,b,sizeof a)
#define mcpy(a,b) memcpy(a,b,sizeof b)
#define xx first
#define yy second
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define pii pair<int,int> 
#define lb(x) ((x)&(-(x)))
#define dalao 1000000007
#define inf 0x3f3f3f3f
#define N 100010
using namespace std;
typedef long long ll;
int n,Q,tp;
ll mi,a[N],t[N],q[N];
int main(){
	scanf("%d%d",&n,&Q);
	q[tp=1]=mi=n;
	while(Q--){
		ll x;scanf("%lld",&x);
		while(tp&&q[tp]>=x)tp--;
		q[++tp]=x,mi=min(mi,x);
	}
	t[tp]=1;
	for(int i=tp;i;i--){
		ll k=q[i];
		int p=i;
		while(k>mi){
			int x=upper_bound(q,q+p,k)-q-1;
			t[x]+=t[i]*(k/q[x]),k%=q[x],p=x;
		}
		a[1]+=t[i],a[k+1]-=t[i];
	}
	for(int i=1;i<=n;i++)a[i]+=a[i-1],printf("%lld\n",a[i]);
	return 0;
}