#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) ;
#endif
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}

typedef long long ll;
typedef long double ld;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)((x).size())
#define pb push_back
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
#define X first
#define Y second
//#define debug(x) cerr << #x << " : " << (x) << " "
const long double PI = 3.14159265358979323846;
const long double eps = (1e-15);
enum {LESS, EQUAL, GREATER};
int dcmp(ld x, ld y, ld EPS = eps)
{
    if (fabs(x - y) <= EPS)
        return EQUAL;
    return x > y ? GREATER : LESS;
}

int n, m, k;
const int MAX_N = 52;
map<vector<int>, ld> mem[MAX_N];

void clear()
{
    rep(i,0,n)
        mem[i].clear();
}

vector<int> need;
bool possible(vector<int> have)
{
    sort(all(have));
    int countHave = 0;
    for (int item : have)
        countHave += item != 0;
    if (countHave > k)
        return false;
    for (int i = sz(have) - 1, j = sz(need) - 1; j >= 0; --j, --i)
    {
        if (have[i] > need[j])
            return false;
    }
    return true;
}

ld solve(int i, const vector<int> &have)
{
    if (i == n)
        return 0;

    if (mem[i].count(have))
        return mem[i][have];
    ld &ret = mem[i][have];
    ret = 1;
    ld pSame = 0;
    vector<ld> v;
    for (int j = 0; j < m; ++j)
    {
        vector<int> newHave = have;
        newHave[j]++;
        if (!possible(newHave))
            pSame += 1.0/m;
        else
        {
            v.push_back(solve(i + 1, newHave));
            ret += 1.0 / m * solve(i + 1, newHave);
        }
    }
    ret = ret/(1.0 - pSame);
    return ret;
}

void myMain()
{
    cin >> n >> m >> k;
    clear();
    need.clear();
    need.resize(k);
    rep(i,0,k)
        cin >> need[i];
    sort(all(need));
    cout << fixed << setprecision(10) << solve(0, vector<int>(m, 0)) << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("AC.txt", "w", stdout);
#endif
    int tc;
    cin >> tc;
    for (int tid = 1; tid <= tc; ++tid)
    {
        cout << "Case #" << tid << ": ";
        myMain();
    }
}