#include <bits/stdc++.h>
using namespace std;
vector<int> vc[1005];
int i, j, n, m, w[1005], l, key, need, all;
bool flag[1005];
double a[1005], b[1005], dp[1005][1005];
bool cmp(const int a, const int b) { return a > b; }
double c(int n, int m) {
  double ans = 1;
  for (int i = 1; i <= m; i++) ans = ans * (n - i + 1) / i;
  return ans;
}
int main() {
  scanf("%d%d", &m, &n);
  for (i = 1; i <= n; i++) {
    int k;
    scanf("%d", &k);
    for (j = 1; j <= k; j++) {
      int x;
      scanf("%d", &x);
      vc[i].push_back(x);
      w[l++] = x;
    }
    sort(vc[i].begin(), vc[i].end());
  }
  sort(w, w + l, cmp);
  key = w[m - 1];
  for (i = 0; i < l; i++)
    if (w[i] == key) {
      need = (m - i);
      break;
    }
  for (i = 1; i <= n; i++) {
    int x = vc[i].size();
    for (j = 0; j < x; j++) {
      if (vc[i][j] >= key) break;
    }
    a[i] = 1.0 / c(x, x - j);
    if (j < x && vc[i][j] == key) {
      b[i] = 1.0 / c(x, x - j - 1);
      all++;
    } else
      flag[i] = 1;
  }
  dp[0][0] = 1;
  for (i = 1; i <= n; i++) {
    for (j = 0; j <= need; j++) {
      if (flag[i])
        dp[i][j] += dp[i - 1][j] * a[i];
      else {
        dp[i][j] += dp[i - 1][j] * b[i];
        if (j > 0) dp[i][j] += dp[i - 1][j - 1] * a[i];
      }
    }
  }
  printf("%.10lf\n", dp[n][need] / c(all, need));
  return 0;
}
