#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::istream& reader = std::cin;
  int n, m;
  reader >> n >> m;
  std::vector<std::vector<int>> a(m);
  std::map<int, std::vector<int>> map;
  for (int i = 0; i < m; ++i) {
    int q;
    reader >> q;
    for (int j = 0; j < q; ++j) {
      int x;
      reader >> x;
      a[i].emplace_back(x);
      map[x].emplace_back(i);
    }
  }
  std::vector<int> b(m);
  while (!map.empty() && n >= map.rbegin()->second.size()) {
    auto it = std::prev(map.end());
    for (int id : it->second) {
      b[id]++;
      --n;
    }
    map.erase(it);
  }
  std::vector<int> c(m);
  int L = 0;
  if (n > 0) {
    (!map.empty());
    for (int id : map.rbegin()->second) {
      c[id] = 1;
      ++L;
    }
  }
  std::vector<std::vector<double>> coef(m, std::vector<double>(2));
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < 2; ++j) {
      double val = 1.0;
      for (int k = 1; k <= b[i] + j; ++k) {
        val = val / ((int)a[i].size() + 1 - k) * k;
      }
      coef[i][j] = val;
    }
  }
  std::vector<std::vector<double>> f(m + 1, std::vector<double>(n + 1));
  f[0][0] = 1.0;
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j <= n; ++j) {
      for (int k = 0; k <= c[i]; ++k) {
        if (j + k <= n) {
          f[i + 1][j + k] += f[i][j] * coef[i][k];
        }
      }
    }
  }
  double result = f[m][n];
  for (int i = 1; i <= n; ++i) {
    result = result / (L + 1 - i) * i;
  }
  printf("%.13f\n", result);
}
