#include <bits/stdc++.h>
using namespace std;
int inf = (1ll << 31) - 1;
int n, m;
double logg[1005];
double sum[1005];
double c[1005][1005];
int temp[1005];
void init() {
  c[0][0] = 1;
  for (int i = 1; i <= 1000; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
}
vector<int> eg[1005];
int v[1005], tot;
int cmp(int a, int b) { return a > b; }
double chose[1005][1005], gl[1005][1005];
int main() {
  init();
  int tt, k;
  tot = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &k);
    for (int j = 0; j < k; ++j) {
      scanf("%d", &tt);
      eg[i].push_back(tt);
      v[tot++] = tt;
    }
  }
  sort(v, v + tot, cmp);
  chose[0][0] = 1;
  gl[0][0] = 1;
  int mo, d;
  for (int i = 1; i <= m; ++i) {
    mo = 0;
    d = 0;
    int has = eg[i].size();
    for (int j = 0; j < has; ++j)
      if (eg[i][j] == v[n - 1])
        d++;
      else if (eg[i][j] > v[n - 1])
        mo++;
    for (int j = n; j >= mo; --j) {
      for (int k = 0; k <= d; ++k) {
        chose[i][j] += chose[i - 1][j - mo - k];
        gl[i][j] += gl[i - 1][j - mo - k] / c[has][mo + k];
      }
    }
  }
  printf("%.9lf\n", gl[m][n] / chose[m][n]);
  return 0;
}
