#include <bits/stdc++.h>
using namespace std;
double c[1010][1010];
double dp[1010][1010];
int a[1010][1010], b[1010], f[1010 * 1010];
bool cmp(int x, int y) { return x > y; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int ct = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    for (int j = 1; j <= b[i]; j++) {
      scanf("%d", &a[i][j]);
      f[++ct] = a[i][j];
    }
  }
  sort(f + 1, f + ct + 1, cmp);
  memset(c, 0, sizeof(c));
  for (int i = 0; i < 1010; i++) {
    c[i][i] = c[i][0] = 1;
    for (int j = 1; j < i; j++) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  int must = 0;
  int tt = 0;
  for (int i = 1; i <= m; i++) {
    int tmp = 0;
    for (int j = 1; j <= b[i]; j++) {
      if (a[i][j] > f[n]) tmp++;
      if (a[i][j] == f[n]) tt++;
    }
    must += tmp;
  }
  dp[0][0] = 1;
  int sum = 0;
  for (int i = 1; i <= m; i++) {
    bool flag = false;
    int tmp = 0;
    for (int j = 1; j <= b[i]; j++) {
      if (a[i][j] == f[n])
        flag = true;
      else if (a[i][j] > f[n])
        tmp++;
    }
    for (int j = 0; j <= n - must; j++) {
      if (!flag) {
        dp[i][j] += dp[i - 1][j] / c[b[i]][tmp];
        continue;
      }
      double p = 1.0 * (n - must - j) / tt;
      dp[i][j] += dp[i - 1][j] / c[b[i]][tmp] * (1 - p);
      if (flag) dp[i][j + 1] += dp[i - 1][j] / c[b[i]][tmp + 1] * p;
    }
    if (flag) tt--;
  }
  printf("%.15lf\n", dp[m][n - must]);
  return 0;
}
