#include <bits/stdc++.h>
using namespace std;
int Get() {
  char c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  int X = c - 48;
  while (c = getchar(), c >= '0' && c <= '9') X = X * 10 + c - 48;
  return X;
}
int main() {
  int M = Get(), N = Get();
  static vector<int> All, List[1000];
  for (int i = 0; i < N; i++) {
    int Len = Get();
    while (Len--) {
      int X = Get();
      List[i].push_back(X);
      All.push_back(X);
    }
  }
  sort(All.begin(), All.end());
  static int X[1000], Y[1000];
  memset(X, 0, sizeof(X));
  memset(Y, 0, sizeof(Y));
  int Value = All[All.size() - M], Total = 0;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < List[i].size(); j++)
      if (List[i][j] > Value) {
        X[i]++;
        M--;
      } else if (List[i][j] == Value) {
        Y[i]++;
        Total++;
      }
  static double C[1001][1001];
  memset(C, 0, sizeof(C));
  for (int i = 0; i <= 1000; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
  }
  static double DP[1001][1001];
  memset(DP, 0, sizeof(DP));
  DP[0][0] = 1;
  for (int i = 0; i < N; i++)
    for (int j = 0; j <= M; j++)
      for (int k = 0; k <= Y[i]; k++)
        if (j >= k) DP[i + 1][j] += DP[i][j - k] / C[List[i].size()][X[i] + k];
  printf("%0.10lf\n", DP[N][M] / C[Total][M]);
  return 0;
}
