#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int tot[N];
int ex[N];
int bas[N];
int id[N];
struct T {
  int id, c;
} ar[N * N];
bool cmp(const T& x, const T& y) { return x.c > y.c; }
int m, n;
double dp[N][N];
double num[N][N];
double Ans(int nd) {
  memset(dp, 0, sizeof(dp));
  memset(num, 0, sizeof(num));
  num[0][0] = 1;
  dp[0][0] = 1.0;
  ex[0] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= nd; ++j)
      if (dp[i][j] != 0) {
        double tmp = 1.0;
        for (int k = 0; k < bas[i + 1]; ++k)
          tmp = tmp * (k + 1) / (tot[i + 1] - k);
        for (int k = 0; k <= ex[i + 1] && k + j <= nd; ++k) {
          dp[i + 1][k + j] += dp[i][j] * tmp;
          num[i + 1][k + j] += num[i][j];
          if (k < ex[i + 1])
            tmp = tmp * (ex[i + 1] - k) / (tot[i + 1] - bas[i + 1] - k) *
                  (bas[i + 1] + k + 1) / (k + 1);
        }
      } else
        break;
  }
  double res = dp[n][nd] / num[n][nd];
  return res;
}
int main() {
  while (scanf("%d%d", &m, &n) == 2) {
    int len = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &tot[i]);
      int t;
      for (int j = 0; j < tot[i]; ++j) {
        scanf("%d", &t);
        ar[len].c = t;
        ar[len].id = i;
        ++len;
      }
    }
    sort(ar, ar + len, cmp);
    memset(bas, 0, sizeof(bas));
    memset(ex, 0, sizeof(ex));
    int t = ar[m - 1].c;
    int ex_n = 0;
    for (int i = 0; i < len; ++i) {
      if (ar[i].c > t)
        ++bas[ar[i].id], ++ex_n;
      else if (ar[i].c == t)
        ++ex[ar[i].id];
      else
        break;
    }
    ex_n = m - ex_n;
    printf("%.10lf\n", Ans(ex_n));
  }
}
