#include <bits/stdc++.h>
using namespace std;
int N, M, i, j, k, l, len, Num, Size;
int C[1005][1005], P[1005], K[1005];
double g, Com[1005][1005], f[1005][1005], G[1005][1005];
int Cmp(const int &i, const int &j) { return i > j; }
int main() {
  scanf("%d%d", &N, &M);
  for (i = 1; i <= M; ++i) {
    scanf("%d", &K[i]);
    for (j = 1; j <= K[i]; ++j) {
      scanf("%d", &C[i][j]);
      P[++Size] = C[i][j];
    }
  }
  sort(P + 1, P + Size + 1, Cmp);
  for (i = 0; i <= 1000; ++i) {
    Com[i][0] = Com[i][i] = 1;
    for (j = 1; j < i; ++j) Com[i][j] = Com[i - 1][j] + Com[i - 1][j - 1];
  }
  f[0][0] = 1;
  G[0][0] = 1;
  for (i = 1; i <= M; ++i) {
    sort(C[i] + 1, C[i] + K[i] + 1, Cmp);
    len = k = Num = 0;
    if (C[i][1] <= P[N])
      for (l = 0; l <= N; ++l) {
        G[i][l] += G[i - 1][l];
        f[i][l] += f[i - 1][l];
      }
    for (j = 1; j <= K[i]; ++j) {
      if (j > k) {
        len = Num = 0;
        for (; k + 1 <= K[i] && C[i][j] == C[i][k + 1]; ++k) ++len;
      }
      ++Num;
      g = Com[len][Num] / Com[K[i]][j];
      if (C[i][j] >= P[N] && C[i][j + 1] <= P[N])
        for (l = j; l <= N; ++l) {
          G[i][l] += G[i - 1][l - j];
          f[i][l] += f[i - 1][l - j] * g;
        }
    }
  }
  printf("%.15lf\n", f[M][N] / G[M][N]);
  return 0;
}
