> File Name: 7.cpp
> Author: jiangyuzhu
> Mail: 834138558@qq.com
> Created Time: 2016/8/9 14:02:54
************************************************************************/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
using namespace std;
const int maxn = 1 << 20, maxm = 20 + 5;
typedef long long ll;
typedef pair<ll, ll>P;
int b[maxm];
vector<bool>vis;
vector<P>dp;
int HP, n, m;
ll gcd(ll a, ll b)
{
return b?gcd(b, a % b): a;
}
int cal(int state)
{
int ans = 0;
while(state){
if(state & 1) ans++;
state >>= 1;
}
return ans;
}
P add(P x, P y)
{
if(x.first == 0 && x.second == 0) x.second = 1;
if(y.first == 0 && y.second == 0) y.second = 1;
ll up = x.first * y.second + y.first * x.second;
ll down = x.second * y.second;
ll g = gcd(up, down);
return P(up / g, down / g);
}
P mul(P x, P y)
{
if(x.first == 0 && x.second == 0) x.second = 1;
if(y.first == 0 && y.second == 0) y.second = 1;
ll up = x.first * y.first;
ll down = x.second * y.second;
ll g = gcd(up, down);
return P(up / g, down / g);
}
P gao(int now, int val, int totn, int tot)
{
if(val >= HP) return P(1, 1);
if(vis[(now + 1) * (n + 1) + totn]) return dp[(now + 1) * (n + 1) + totn];
vis[(now + 1) * (n + 1) + totn] = true;
if(tot == 0) return P(0, 1);
int totm = cal(now);
if(totn > 0) dp[(now + 1) * (n + 1) + totn] = mul(gao(now, val, totn - 1, tot + 1), P(totn, totm + totn));
else dp[(now + 1) * (n + 1) + totn] = P(0, 1);
for(int i = 0; i < m; i++){
if((now >> i) & 1){
P tmp = gao(now ^ (1 << i), val + b[i], totn, tot - 1) ;
tmp = mul(tmp, P(1, totm + totn));
dp[(now + 1) * (n + 1) + totn] = add(dp[(now + 1) * (n + 1) + totn], tmp);
}
}
return dp[(now + 1) * (n + 1) + totn];
}
int main (void)
{
int T;scanf("%d", &T);
while(T--){
scanf("%d%d%d", &HP, &n, &m);
for(int i = 0; i < m; i++) scanf("%d", &b[i]);
vis.resize((1 << m) * (n + 1) + n + 1);
vis.clear();
dp.resize((1 << m) * (n + 1) + n + 1);
dp.clear();
P ans = gao((1 << m) - 1, 0, n, 1);
printf("%lld/%lld\n", ans.first, ans.second);
}
return 0;
}