#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define F first
#define S second
#define pss pair<string,string>
#define pcc pair<char,char>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define piii pair<int,pii>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define vs vector<string>
#define vl vector<ll>
#define vs vector<string>
#define vll vector<pll>
#define vss vector<pss>
#define vcc vector<pcc>
#define MP make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=n-1;i>=0;i--)
#define Very_fast std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int N = 1e5+5;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
inline ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll lowbit(ll x){return (x&-x);}
inline ll kissme(ll x,ll y)
{
	ll res=1;
	if(x==0)return 1;
	if(x==1)return y;
	res=kissme(x/2,y);
	res=res*res%mod;
	if(x%2==1)res=res*y%mod;
	return res;
}
string QAQ(string s)
{
	string a=s,b=s;
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	reverse(a.begin(),a.end());
//	cout<<a<<" "<<b<<"\n";
	for(int i=a.size()-1;i>=0;i--)
	{
		a[i]-=b[i]-'0';
		if(a[i]<'0')
		{
			a[i-1]--;
			a[i]+=10;
		}
	}
	while(!a.empty()&&a[0]=='0')a.erase(a.begin());
	return a;
}
string s;
int n;
signed main()
{
	Very_fast;
	cin>>s>>n;
	rep(i,n)
	{
		s=QAQ(s);
		if(s=="")
		{
			cout<<"0\n";
			return 0; 
		}
	}
	int rem=s.size()-1;
	for(int i=0;i<s.size()-1;i++)
	{
		if(s[i]!='0')
		{
			rem=i;
			break;
		}
	}
	for(int i=rem;i<s.size();i++)
		cout<<s[i];
	return 0;
}
#include<bits/stdc++.h>

using namespace std;

using ll = long long;

/*-----for personal-----*/
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define repn(i,n)  rep(i,0,n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

/*-----for lib-----*/
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) std::begin(x), std::end(x)

const long double EPS = 1e-12;
const int MOD = 1e9+7;
const int INF = INT_MAX / 2;
const ll LLINF = LLONG_MAX / 2;
//for(auto &h : H){ cout << h << " ";} cout << endl;
//for(auto &h : H){for(auto &k:h){cout << k << " ";}cout << endl;}
//for(auto [k,v] : mp){cout << k << " " << v << endl;}
//for(auto [k,v] : mp){cout << k << " "; for(auto &u:v){cout << u << " ";}cout << endl;}

/*
f(n) = (f(n+1)+1) * 1/M + (f(n+2)+1) * 1/M + .... + (f(n+M)+1) * 1/M
     = 1/M (f(n+1)+1+f(n+2)+1+f(n+3)+1+f(n+M)+1)
     = 1/M (f(n+1)+f(n+2)+...+f(n+M)+M)
     = 1/M (f(n+1)+f(n+2)+...+f(n+M)) + 1
f(n) = f(0) [循環する]

g(n) = 1/M (g(n+1)+g(n+2)+....+g(n+M)) + 1 振り出しじゃない
g(n) = X 振り出し


g(0) = 1/M (g(1)+g(2)+....+g(M)) + 1

f(0) - f(0)A = B
(1-A)f(0) = B

Mf(0) = MB/(M-MA)
A = 1/M*(1~Nでgが振り出しの数)
B = 1/M+(1~Mでgが振り出しでない数)+1
MA = (1~Nでgが振り出しの数)
MB = (1~Mでgが振り出しでない数)+M
*/

const int N = 100000;
const int M = 100000;
vector<bool> A(N+1,false);
vector<long double> dp(N+M, 0);
vector<long double> S(N+M, 0);
int n, m, k;

long double f(long double v){
  for(int i = n-1; i>=0; i--){
    if(A[i]){
      dp[i] = v;
    }else{
      dp[i] = 1+(S[i+1]-S[i+1+m])/m;
    }
    S[i] = dp[i] + S[i+1];
  }
  return dp[0];
}


int main(){
  cin >> n >> m >> k;
  repn(i,k){
    int a; cin >> a;
    A[a] = true;
  }

  int count = 0;
  for(int i = 0; i <= n; i++){
    if(!A[i]){count=0; continue;}
    count++;
    if(count>=m){ cout << -1 << endl; return 0;}
  }

  long double l=0, r=1e12, mid;
  //mid -> v
  count = 0;
	while(count<=100) {
		mid=(l+r)/2;
		if(abs(f(mid)-mid)<EPS) break;
    else if(f(mid)>mid) l=mid;
		else r=mid;
    count++;
	}

  cout << setprecision(12) << mid << endl;

}
