#include <bits/stdc++.h>
using namespace std;
struct rec {
  int value, from;
};
int n, m, MaxP, i, j, cnt;
double C[1002][1002];
int p[1002];
int certain[1002], uncertain[1002];
int a[1002][12];
double S[1002];
double c[1002];
rec b[10002];
bool cmp1(int x, int y) { return (x > y); }
bool cmp2(rec x, rec y) { return (x.value > y.value); }
int main() {
  MaxP = 0;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; ++i) {
    scanf("%d", &p[i]);
    MaxP = max(MaxP, p[i]);
    for (j = 1; j <= p[i]; ++j) {
      scanf("%d", &a[i][j]);
      cnt++;
      b[cnt].value = a[i][j];
      b[cnt].from = i;
    }
  }
  C[0][0] = 1;
  for (i = 1; i <= MaxP; ++i) {
    C[i][0] = 1;
    for (j = 1; j <= i; ++j) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  }
  for (i = 1; i <= m; ++i) sort(a[i] + 1, a[i] + p[i] + 1, cmp1);
  sort(b + 1, b + cnt + 1, cmp2);
  for (i = 1; i <= n; ++i) certain[b[i].from]++;
  if (n < cnt && b[n].value == b[n + 1].value) {
    i = n;
    while (b[i].value == b[n + 1].value && i > 0) {
      certain[b[i].from]--;
      uncertain[b[i].from] = 1;
      i--;
    }
    i = n + 1;
    while (i <= cnt && b[i].value == b[n + 1].value) {
      uncertain[b[i].from] = 1;
      i++;
    }
  }
  for (i = 1; i <= m; ++i) n = n - certain[i];
  S[0] = 1;
  c[0] = 1;
  for (i = 1; i <= m; ++i) {
    for (j = n; j > 0; --j) {
      S[j] = S[j] / C[p[i]][certain[i]];
      if (uncertain[i]) {
        S[j] = S[j] + S[j - 1] / C[p[i]][certain[i] + 1];
        c[j] = c[j] + c[j - 1];
      }
    }
    S[0] = S[0] / C[p[i]][certain[i]];
  }
  printf("%.10lf\n", S[n] * 1.0 / c[n]);
}
