#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
double nCk[N][N], dp[N][N];
int n, m, k[N], c[N][N], may[N], must[N];
vector<int> v;
double choose(int n, int k) {
  if (k > n || k < 0) return 0;
  return nCk[n][k];
}
int main() {
  nCk[0][0] = 1;
  for (int n = 0; n < N; n++)
    for (int k = 0; k < N; k++)
      if (n || k)
        nCk[n][k] = ((k - 1 >= 0 && k - 1 <= n - 1) ? nCk[n - 1][k - 1] : 0) +
                    ((k >= 0 && k <= n - 1) ? nCk[n - 1][k] : 0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> k[i];
    for (int j = 0; j < k[i]; j++) {
      cin >> c[i][j];
      v.push_back(c[i][j]);
    }
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int may_cutoff = v[n - 1];
  int large_set = 0, small_set = n;
  for (int i = 0; i < m; i++) {
    may[i] = must[i] = 0;
    for (int j = 0; j < k[i]; j++) {
      if (c[i][j] == may_cutoff) {
        may[i]++;
      } else if (c[i][j] > may_cutoff) {
        must[i]++;
      }
    }
    large_set += may[i];
    small_set -= must[i];
  }
  dp[0][0] = 1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j <= small_set; j++) {
      for (int w = 0; w <= may[i]; w++) {
        if (j + w <= small_set) {
          double p = choose(may[i], w) *
                     choose(large_set - may[i], small_set - (j + w)) /
                     choose(large_set, small_set - j);
          p *= choose(may[i], w) / choose(k[i], w + must[i]);
          dp[i + 1][j + w] += dp[i][j] * p;
        }
      }
    }
    large_set -= may[i];
  }
  printf("%0.16lf\n", dp[m][small_set]);
}
