#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double PI = acos(-1);
template <class T, class S>
inline void add(T& a, S b) {
  a += b;
  if (a >= mod) a -= mod;
}
template <class T, class S>
inline void sub(T& a, S b) {
  a -= b;
  if (a < 0) a += mod;
}
template <class T, class S>
inline bool chkmax(T& a, S b) {
  return a < b ? a = b, true : false;
}
template <class T, class S>
inline bool chkmin(T& a, S b) {
  return a > b ? a = b, true : false;
}
int n, m, num1, num2;
int cnt[N];
int need[N];
bool have[N];
vector<pair<int, int> > vc;
long double dp[N][N];
long double comb[N][N];
int main() {
  for (int i = 0; i < N; i++)
    for (int j = comb[i][0] = 1; j <= i; j++)
      comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &cnt[i]);
    for (int j = 1; j <= cnt[i]; j++) {
      int x;
      scanf("%d", &x);
      vc.push_back(make_pair(x, i));
    }
  }
  sort(vc.rbegin(), vc.rend());
  int val = vc[n - 1].first;
  num1 = n;
  num2 = 0;
  if (((int)vc.size()) == n || vc[n].first != val) val = -1;
  if (~val) {
    for (auto& t : vc) {
      if (t.first > val)
        need[t.second]++, num1--;
      else if (t.first == val)
        have[t.second] = true, num2++;
      else
        break;
    }
  } else {
    for (int i = 0; i < n; i++) need[vc[i].second]++;
    num1 = 0, num2 = 0;
  }
  dp[0][0] = 1.0;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= i && j <= num1; j++) {
      if (!have[i]) {
        dp[i][j] = dp[i - 1][j] / comb[cnt[i]][need[i]];
      } else {
        if (j)
          dp[i][j] = dp[i - 1][j] / comb[cnt[i]][need[i]] +
                     dp[i - 1][j - 1] / comb[cnt[i]][need[i] + 1];
        else
          dp[i][j] = dp[i - 1][j] / comb[cnt[i]][need[i]];
      }
    }
  }
  printf("%.15f\n", (double)(dp[m][num1] / comb[num2][num1]));
  return 0;
}
