#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdlib>
using namespace std;
#define LL long long
#define LD long double
#define DB double
int read(){
	char ch=getchar();int x=0,fl=1;
	for(;!isdigit(ch);ch=getchar())if(ch=='-')fl=-1;
	for(;isdigit(ch);ch=getchar())x=(x<<3)+(x<<1)+(ch-'0');
	return x*fl;
}
const int NN=200000+17;
void open(){
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
}
void FAIL(){
	puts("-1");
	exit(0);
}

const LD EPS=1e-15; 
int n,m,k;
bool cut[NN];
LD f[NN],sf[NN];
LD ans;
bool fl[NN];
int pf[NN];
LD cal(LD mid){
	for(int i=n;i<=n+m;i++)f[i]=0.0;
	for(int i=n-1;i>=0;i--){
		if(cut[i]){
			f[i]=mid;
		}else{
			f[i]=(sf[i+1]-sf[i+m+1])/(m*1.0)+1.0;
		}
		sf[i]=sf[i+1]+f[i];
	}
	return abs(f[0]-mid);
}
bool chk(){
	for(int i=n;i<=n+m;i++)fl[i]=1;
	for(int i=n+m;i>=n;i--)pf[i]=pf[i+1]+fl[i];
	for(int i=n-1;i>=0;i--){
		if(cut[i])fl[i]=0;	
		else{
			fl[i]=pf[i+1]>pf[i+m+1];
		}
		pf[i]=pf[i+1]+fl[i];
	}
	return fl[0];
}

int main(){
	//open();
	srand(20210123);
	n=read();
	m=read();
	k=read();
	for(int i=1;i<=k;i++){
		int x=read();
		cut[x]=true;
	}
	if(!chk())FAIL();
	LD ll=0,rr=2e18;
	for(int tim=1;tim<=200&&ll+EPS<rr;tim++){
		LD mid=ll+(rr-ll)/3.0,mid2=rr-(rr-ll)/3.0;
		if(cal(mid)<cal(mid2))
			rr=mid2;
		else
			ll=mid; 
	}
	printf("%.10Lf\n",ll);
	return 0;
}

#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <time.h>
#include <unordered_map>

//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

using namespace std;
using ll = long long;
typedef std::pair<int, int> pii;
typedef std::pair<int, double> pid;
typedef std::vector<int> vi;
typedef std::vector<pii> vii;
#define PI 3.14159265358979323846264338327950L

const int mod = 1000000007;


struct container{
    int bottom, top, id;
    container(int id, int bottom, int top): top(top), bottom(bottom),id(id){
    }
};


struct Data {
    int ind;
    ll time;
    Data(int ind,ll time): ind(ind),time(time){}
    bool operator<(const Data& a) const {
    return time > a.time;
    }
};




void solve(){
    
    ll n,k;
    cin >> n >> k;
    
    vector<vector<ll>> d(n,vector<ll> (n,0));
    rep(i,n){
        rep(j,n) cin >> d[i][j];
    }
    
    vector<int> a;
    rep(i,n-1) a.pb(i);
    
    int ans = 0;
    do{
        
        ll D = 0;
        
        D += d[0][a[0]+1];
        rep(i,n-2){
            D += d[a[i]+1][a[i+1]+1];
        }
        D += d[a[n-2]+1][0];
        
        if (D==k) ans++;
            
    }while(next_permutation(begin(a),end(a))); 
    
    
    cout << ans;
    
}





int main() {
    int T = 1;
    //cin >> T;
    
    while (T--){
        solve();
        cout << endl;
    }
}





 