#include <bits/stdc++.h>
int a[1100], _[1100], p[1100], Bel[1100], q[1100], End, i, j, k, l, n, m;
double D, Ans, f[1100][1100];
bool cmp(int i, int j) { return a[i] > a[j]; }
int main() {
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", p + i);
    for (j = 0; j < p[i]; j++) {
      _[End] = End;
      Bel[End] = i;
      scanf("%d", a + End++);
    }
  }
  std::sort(_, _ + End, cmp);
  Ans = 1;
  for (i = 0; i < End && n; i = j) {
    for (j = i; j < End && a[_[j]] == a[_[i]]; j++)
      ;
    if (j - i <= n) {
      n -= j - i;
      for (k = i; k < j; k++) {
        Ans = Ans * (q[Bel[_[k]]] + 1) / (p[Bel[_[k]]] - q[Bel[_[k]]]);
        q[Bel[_[k]]]++;
      }
    } else {
      D = (1.0 * n) / (j - i);
      f[i][0] = 1;
      for (k = i; k < j; k++)
        for (l = 0; l <= k - i; l++) {
          f[k + 1][l + 1] += f[k][l] * (l + 1) / (k - i + 1) *
                             (q[Bel[_[k]]] + 1) / (p[Bel[_[k]]] - q[Bel[_[k]]]);
          f[k + 1][l] += f[k][l] * (k - i + 1 - l) / (k - i + 1);
        }
      Ans *= f[j][n];
      n = 0;
    }
  }
  printf("%.10lf\n", Ans);
  return 0;
}
