#include <bits/stdc++.h>
using namespace std;
double c[1010][1010];
int f[1010][1010], k[1010], a[1010], aa, n, m;
double dp[1010][1010];
bool cmp(int x, int y) { return x > y; }
int main() {
  c[0][0] = 1;
  for (int i = 1; i <= 1000; 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);
  aa = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &k[i]);
    for (int j = 1; j <= k[i]; j++) {
      scanf("%d", &f[i][j]);
      aa++;
      a[aa] = f[i][j];
    }
  }
  sort(a + 1, a + aa + 1, cmp);
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  int tmp1 = 0, tmp2 = n;
  for (int i = 1; i <= m; i++) {
    int z = 0;
    bool flag = false;
    for (int j = 1; j <= k[i]; j++)
      if (f[i][j] > a[n])
        z++;
      else if (f[i][j] == a[n])
        flag = true;
    tmp1 += flag;
    tmp2 -= z;
    for (int j = n; j >= z; j--) {
      dp[i][j] = dp[i - 1][j - z] / c[k[i]][z];
      if (flag && j > z) dp[i][j] += dp[i - 1][j - z - 1] / c[k[i]][z + 1];
    }
  }
  printf("%.12lf\n", dp[m][n] / c[tmp1][tmp2]);
  return 0;
}
