#include <bits/stdc++.h>
using namespace std;
template <class T>
void PV(T x) {
  for (__typeof__((x).begin()) i = (x).begin(); i != (x).end(); ++i)
    cout << *i << " ";
  cout << endl;
}
vector<double> fac;
double logC(int a, int b) { return fac[a] - fac[b] - fac[a - b]; }
int main(int argc, char *argv[]) {
  int n, m;
  cin >> n >> m;
  vector<int> a[m];
  for (int n_ = (m), i = 0; i < n_; ++i) {
    int ki;
    cin >> ki;
    while (ki--) {
      int aij;
      cin >> aij;
      a[i].push_back(aij);
    }
  }
  vector<int> all;
  for (int n_ = (m), i = 0; i < n_; ++i)
    all.insert(all.end(), (a[i]).begin(), (a[i]).end());
  sort((all).begin(), (all).end());
  reverse((all).begin(), (all).end());
  int least = all[n - 1];
  for (auto &ai : all)
    if (ai > least) n--;
  fac.assign(1, 0.0);
  for (int n_ = (all.size()), i = 0; i < n_; ++i)
    fac.push_back(fac.back() + log(i + 1));
  double dp[m + 1][n + 1];
  for (int n_ = (m + 1), i = 0; i < n_; ++i)
    for (int n_ = (n + 1), j = 0; j < n_; ++j) dp[i][j] = -1.0;
  dp[0][0] = 0.0;
  int allEqual = 0;
  for (int n_ = (m), i = 0; i < n_; ++i) {
    int larger = 0, equal = 0;
    for (auto &aij : a[i])
      if (aij > least)
        larger++;
      else if (aij == least)
        equal++;
    allEqual += equal;
    for (int n_ = (n + 1), j = 0; j < n_; ++j) {
      double &ret = dp[i + 1][j];
      ret = 0.0;
      for (int n_ = (equal + 1), k = 0; k < n_; ++k) {
        if (j - k >= 0 && dp[i][j - k] != -1.0) {
          double u = logC(equal, k);
          double d = logC(a[i].size(), larger + k);
          ret += exp(u - d + dp[i][j - k]);
        }
      }
      if (ret == 0.0)
        ret = -1.0;
      else
        ret = log(ret);
    }
  }
  cout << setiosflags(ios::fixed);
  cout << setprecision(18);
  cout << exp(dp[m][n] - logC(allEqual, n)) << endl;
  return 0;
}
