#include <bits/stdc++.h>
using namespace std;
vector<int> a[1011];
int b[1011];
int tl;
double g[1011][1011];
double f[1011][1011];
double c[1011][1011];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int num, x;
    scanf("%d", &num);
    for (int j = 0; j < num; j++) {
      scanf("%d", &x);
      a[i].push_back(x);
      b[tl++] = x;
    }
  }
  for (int i = 0; i < 1005; i++)
    for (int j = 0; j <= i; j++)
      c[i][j] = (i && j) ? c[i - 1][j] + c[i - 1][j - 1] : 1;
  sort(b, b + tl, cmp);
  int gang = b[n - 1];
  f[0][0] = g[0][0] = 1;
  for (int i = 0; i < m; i++) {
    int must = 0, mb = 0;
    int sz = a[i].size();
    for (int j = 0; j < a[i].size(); j++) {
      if (a[i][j] > gang) must++;
      if (a[i][j] == gang) mb++;
    }
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= mb; k++) {
        if (j + must + k <= n) g[i + 1][j + must + k] += g[i][j];
        if (j + must + k <= n) {
          f[i + 1][j + must + k] += f[i][j] * 1.0 / c[sz][must + k];
        }
      }
    }
  }
  printf("%.12f\n", f[m][n] / g[m][n]);
  return 0;
}
