#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, m, mi;
int lim[N], sum[N], a[N];
vector<int> A;
vector<int> v[N];
long double f[N][N], C[N][N], p[N][N];
void init() {
  for (int i = (0); i < (N); i++) C[i][0] = C[i][i] = 1;
  for (int i = (0); i < (N); i++)
    for (int j = (1); j < (i); j++) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  init();
  cin >> n >> m;
  for (int i = (1); i < (m + 1); i++) {
    int k;
    cin >> k;
    for (int j = (0); j < (k); j++) {
      int x;
      cin >> x;
      v[i].push_back(x);
      A.push_back(x);
    }
  }
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  mi = A[n - 1];
  for (int i = (1); i < (m + 1); i++) {
    for (auto u : v[i]) {
      a[i] += (u > mi);
      lim[i] += (u == mi);
    }
    sum[i] = sum[i - 1] + lim[i], n -= a[i];
  }
  f[0][0] = p[0][0] = 1;
  for (int i = (1); i < (m + 1); i++)
    for (int j = (0); j < (min(n, sum[i]) + 1); j++)
      if (j + sum[m] - sum[i] >= n) {
        long double t = 0;
        if (sum[i - 1] >= j) t += p[i - 1][j];
        if (sum[i - 1] >= j - 1 && lim[i] && j) t += p[i - 1][j - 1];
        if (sum[i - 1] >= j)
          f[i][j] += f[i - 1][j] / C[(int)v[i].size()][a[i]] * p[i - 1][j] / t;
        if (sum[i - 1] >= j - 1 && lim[i] && j)
          f[i][j] += f[i - 1][j - 1] / C[(int)v[i].size()][a[i] + 1] *
                     p[i - 1][j - 1] / t;
        p[i][j] = t;
      }
  cout << setiosflags(ios::fixed);
  cout << setprecision(10);
  cout << (double)f[m][n] << "\n";
  return 0;
}
