#include<bits/stdc++.h>
using namespace std;
using namespace std::chrono;

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vector<int>>
#define mi  map<int,int>
#define mii map<pii,int>
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define sz(x) (int)x.size()
#define all(v) (v).begin(), (v).end()   
#define ret(x) return cout<<x,0;
#define rety return cout<<"Yes",0;
#define retn return cout<<"No",0;
#define fl fflush(stdout)   
#define hell 1000000007
#define hell2 998244353 
#define pi 3.14159265358979323846
#define piii pair<pii,int>
int fexp(int a, int b,int m){int ans = 1;while(b){if(b&1)ans=ans*a%m; b/=2;a=a*a%m;}return ans;}
int inverse(int a, int p){return fexp(a, p-2,p);} 

int fac[300005]; //fac[0]=0;fac[1]=1;rep(i,2,300005)fac[i]=(fac[i-1]*i)%hell;

int ncr(int n, int r,int p) { 
    if (r==0) return 1; 
    return (fac[n]*inverse(fac[r],p)%p*inverse(fac[n-r],p)%p)%p; 
}

bool sortby(piii &a,piii &b){
    if(a.ff.ff==b.ff.ff)return (a.ff.ss<b.ff.ss);
    return (a.ff.ff<b.ff.ff);
    if(a.ss==b.ss)return (a.ff<b.ff);
    return (a.ss<b.ss);
}


int solve(){
    int n,m,a;
    cin>>n>>m;
   // if(m==0)ret(1);
    vi v;
    v.pb(0);
    rep(i,0,m){
        cin>>a;
        v.pb(a);
    }
    sort(all(v));
    v.pb(n+1);
    int g=1e18;
    rep(i,1,sz(v)){
        //cout<<v[i]-v[i-1]-1<<" ";
        if(v[i]!=v[i-1]+1)
        g=min(g,v[i]-v[i-1]-1);
    }
    int ans=0;//ret(g);
    rep(i,1,sz(v)){
        ans+=((v[i]-v[i-1]-1+g-1)/g);
    }
    cout<<ans;
    return 0;   
}

signed main(){
    auto start = high_resolution_clock::now();
    IOS;
    int t=1;

    //cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    cerr<<"Time taken:"<<duration.count()/1000000.0<<"seconds"<<"\n";
    return 0;
}

/*
　　　　　／＞　 フ
　　　　　| 　_　 _|
　 　　　／`ミ _x 彡
　　 　 /　　　 　 |
　　　 /　  ヽ　　 ?
　／￣|　　 |　|　|
　| (￣ヽ＿_ヽ_)_)
　＼二つ
 */

#pragma GCC optimize(2)
#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
	static short st[30];short tp=0;
	if(x<0) putchar('-'),x=-x;
	do st[++tp]=x%10,x/=10; while(x);
	while(tp) putchar('0'|st[tp--]);
	putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 102;
int n, k, P, ans[N], lim;
int f[N][N*N*N/2], sum[N*N*N/2];
inline void add(int &x, int y) { x += y, x >= P && (x -= P); }
void work(void) {
	f[0][0] = 1;
	for (int i = 1;i <= n; i++) {
		lim += i * k;
		for (int j = 0;j <= lim; j++) 
			sum[j] = (f[i-1][j] + (j >= i ? sum[j-i] : 0)) % P;
		for (int j = lim;j >= 0; j--) 
			f[i][j] = sum[j], j >= (k + 1) * i && (add(f[i][j], P - sum[j - (k + 1) * i]), 0);
	}
}


int main() {
	read(n), read(k), read(P), work();
	for (int i = 1;i <= n; i++) {
		ll ans = k;
		for (int t = 1;t <= lim; t++) 
			ans = (ans + (ll)(k + 1) * f[i-1][t] % P * f[n-i][t]) % P;
		write(ans);
	}
	return 0;
}

/*

100 100 998244353

*/