#pragma GCC optimize ("-O2")
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
using namespace std; 
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, 
            rb_tree_tag, 
            tree_order_statistics_node_update> 
    pbds; 
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define endl '\n'
#define loop(var,a,b,c) for(ll var=a;var<=b;var+=c)
#define intarr(arr,n) ll arr[n];for(ll i=0;i<n;i++)cin>>arr[i]
#define inparr(arr,n) for(ll i=0;i<n;i++)cin>>arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
#define newline cout<<endl
#define ump unordered_map<ll,ll>
#define vec vector<ll>
#define mkp make_pair
#define disp(var1,var2) cout<<var1<<" "<<var2<<endl;
#define all(v)             v.begin(),v.end()
#define cout(var) cout<<var<<endl
#define mod2 998244353
#define fbo finte_by_order  /// finte kth smallest by passing k-1
#define ook order_of_key  //// finte no of smaller items less than k
#define teensort(a,r,g,b) a[0]=r;a[1]=g;a[2]=b;sort(a,a+3);
#define ss second
#define ff first
#define displayarray(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "; cout<<endl;
#define pi pair<ll,ll>
#define meramax 1e18
#define meramin -1e18
#define percentile 1000000007
#define PI 3.14159265358979323846
#define input2darr(n,m,in) ll a[n+1][m+1];if(in==0){loop(i,0,n-1,1)loop(j,0,m-1,1)cin>>a[i][j];}else{loop(i,1,n,1)loop(j,1,m,1)cin>>a[i][j];}
#define output2darr(n,m,in) if(in==0){loop(i,0,n-1,1){loop(j,0,m-1,1)cout<<a[i][j]<<" ";cout<<endl;}}else{loop(i,1,n,1){loop(j,1,m,1)cout<<a[i][j]<<" ";}cout<<endl;}
#define minheap priority_queue<ll>
#define maxheap priority_queue<ll,vector<ll>,greater<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////                                     ///////////////////////////////////////////////////////////////
////////////////////////////////////////              CODE                   ///////////////////////////////////////////////////////////////
////////////////////////////////////////                                     ///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bool valid(ll nn,ll m,auto &x)
{
    __int128 ans=0,c=1;
    for(ll i=0;i<x.length();i++)
    {
        if(c>m)return false;
        ll val=x[i]-'0';
        ans+=c*val;
        if(ans>m)return false;
        c*=nn;
    }
    return true;
}
void AcDegaYe()
{
    string s;
    cin>>s;
    ll m;
    cin>>m;
    ll mx=0;
    for(ll i=0;i<s.length();i++)
    {
        char ch=s[i];
        ll no=ch-'0';
        mx=max(mx,no);
    }
    if(s.length()==1)
    {
        if(s[0]-'0'<=m)cout(1);
        else cout(0);
        return;
    }
    ll ans=0;
    ll i=mx+1;
    reverse(all(s));
    ll st=i;
    ll e=1e18;
    // if(m==1e18)
    // {
    //     cout(1);
    //     return;
    // }
    while(st<=e)
    {
        //cout(i);
        ll mid=st+(e-st)/2;
        //cout(mid);
        if(valid(mid,m,s))
        {
            st=mid+1;
        }
        else
        {
            e=mid-1;
        }
    }
    cout(st-i);
}
int main()
{   
    fastio

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    //ll t;
    //cin>>t;
    ll t=1;
    for(ll i=0;i<t;i++)
    {
        AcDegaYe();
    }
    //cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

#include<bits/stdc++.h>
#define mxn 200005
#define ld long double
using namespace std;
ld res[mxn], deno[mxn];
bool vis[mxn];
int ara[12];
int main()
{
    int n, m, k;
    scanf("%d %d %d", &n, &m, &k);

    for(int i=0; i<k; i++)
    scanf("%d", &ara[i]), vis[ ara[i] ]= 1;

    int mx= 0;
    for(int i=0; i<=n; i++)
    if(vis[i])
    {
        int cnt= 0;
        while(vis[i])cnt++, i++;
        mx= max(mx, cnt);
    }

    if(mx>=m)
    {
        puts("-1");
        return 0;
    }

    ld sum= 0.0, sum2= 0.0;
    for(int i=n-1; i>=0; i--)
    {
        sum-= res[i+m+1];
        sum2-= deno[i+m+1];

        if(!vis[i])
        {
            for(int j=0; j<k; j++)
            if(ara[j]>i && ara[j]<=i+m)deno[i]+= (1.0/(ld)m);

            res[i]= 1.0+(1.0/(ld)m)*sum;
            sum+= res[i];

            deno[i]+= (1.0/(ld)m)*sum2;
            sum2+= deno[i];
        }
    }

    printf("%.10Lf\n", res[0]/(1.0-deno[0]));

    return 0;
}
