#include <bits/stdc++.h>
using namespace std;
vector<int> item[1005];
double cnt[1005][1005];
double f[1005][1005];
double g[1005][1005];
int v[1005];
int n, m, c;
double dp() {
  int i, j, k, c1, c2;
  for (i = 0; i <= min(c, 1000); ++i) cnt[i][0] = 1;
  for (i = 1; i <= min(c, 1000); ++i)
    for (j = 1; j <= i; ++j) cnt[i][j] = cnt[i - 1][j - 1] + cnt[i - 1][j];
  f[0][0] = g[0][0] = 1.0;
  for (i = 0; i <= m - 1; ++i) {
    c1 = 0, c2 = 0;
    for (vector<int>::iterator x = item[i + 1].begin(); x != item[i + 1].end();
         x++)
      if (*x > v[n])
        ++c1;
      else if (*x == v[n])
        ++c2;
    for (k = 0; k <= n; ++k)
      for (j = 0; j <= c2; ++j)
        if (k + j + c1 <= n) {
          g[i + 1][j + k + c1] += g[i][k];
          f[i + 1][j + k + c1] += f[i][k] / cnt[item[i + 1].size()][c1 + j];
        }
  }
  return f[m][n] / g[m][n];
}
int main() {
  int i, k, x;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; ++i) {
    scanf("%d", &k);
    while (k--) {
      scanf("%d", &x);
      item[i].push_back(x);
      v[++c] = x;
    }
  }
  sort(&v[1], &v[c + 1], greater<int>());
  printf("%.10lf\n", dp());
  return 0;
}
