#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int k[1011], a[1011];
pair<int, int> gift[1011];
double c[1011];
long double dp[1011];
void pre() {
  for (int i = 1; i < 1011; i++) c[i] = c[i - 1] + log(i);
}
int main() {
  int n, m;
  cin >> n >> m;
  int nn = 0;
  pre();
  for (int i = 0; i < m; i++) {
    scanf("%d", k + i);
    for (int j = 0, c; j < k[i]; j++) {
      scanf("%d", &c);
      gift[nn++] = make_pair(c, i);
    }
  }
  sort(gift, gift + nn);
  reverse(gift, gift + nn);
  int d = gift[n - 1].first, f = 0, who;
  if (nn > 1011) assert(0);
  dp[0] = 1;
  for (int i = 0; i < nn; i++) {
    if (gift[i].first < d) break;
    who = gift[i].second;
    if (gift[i].first > d)
      a[who]++, n--;
    else {
      f++;
      for (int j = min(f, n); j >= 1; j--) {
        dp[j] = dp[j] * (f - j) / f +
                dp[j - 1] * (a[who] + 1) * j / (k[who] - a[who]) / f;
      }
    }
  }
  dp[n] = log(dp[n]);
  for (int i = 0; i < m; i++) dp[n] -= c[k[i]] - c[a[i]] - c[k[i] - a[i]];
  printf("%.10lf\n", (double)exp(dp[n]));
  return 0;
}
