#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1009], c[1009][1009];
int X[1009], tot;
map<int, int> mp;
vector<int> G[1009];
int cnt[1009];
double dp[1009][1009];
int cc[1009];
double C[1009][1009];
inline bool cmp(int x, int y) { return x > y; }
int main() {
  for (int i = 0; i < 1009; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
  }
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    for (int j = 1; j <= a[i]; j++) {
      scanf("%d", &c[i][j]);
      X[tot++] = c[i][j];
    }
  }
  sort(X, X + tot, cmp);
  tot = unique(X, X + tot) - X;
  for (int i = 0; i < tot; i++) {
    mp[X[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= a[i]; j++) {
      G[mp[c[i][j]]].push_back(i);
    }
  }
  int pos = 0, cur = 0;
  for (int i = 0; i < tot; i++) {
    if (cur + (int)G[i].size() >= n) {
      pos = i;
      break;
    } else {
      cur += G[i].size();
    }
  }
  double P = 1;
  for (int i = 0; i < pos; i++) {
    for (int j = 0; j < (int)G[i].size(); j++) {
      cnt[G[i][j]]++;
    }
  }
  for (int i = 1; i <= m; i++) {
    P *= C[a[i]][cnt[i]];
  }
  P = 1 / P;
  int nn = G[pos].size();
  for (int i = 1; i <= nn; i++) cc[i] = G[pos][i - 1];
  dp[0][0] = P;
  for (int i = 0; i < nn; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j + 1] += dp[i][j] * (cnt[cc[i + 1]] + 1) /
                          (a[cc[i + 1]] - cnt[cc[i + 1]]) * C[i][j] /
                          C[i + 1][j + 1];
      dp[i + 1][j] += dp[i][j] * C[i][j] / C[i + 1][j];
    }
  }
  printf("%.10f\n", dp[nn][n - cur]);
  return 0;
}
