#include <bits/stdc++.h>
using namespace std;
long long n, m, opt[1024], ness[1024], notn[1024], sumNess;
long double com[1024][1024];
vector<long long> arr[1024], all;
long double mem[1024][1024];
long double getKofN(long long x, long long y) {
  if (x == 0 || x == y) {
    return 1;
  }
  if (com[y][x]) {
    return com[y][x];
  }
  return com[y][x] = 1 / (1 / getKofN(x, y - 1) + 1 / getKofN(x - 1, y - 1));
}
long double get(long long cOpt, long long ind) {
  if (ind == m) {
    if (cOpt == n - sumNess) {
      return 1;
    }
    return 0;
  }
  if (mem[cOpt][ind]) {
    return mem[cOpt][ind] - 1;
  }
  long double ret =
      (long double)getKofN(ness[ind], arr[ind].size()) * get(cOpt, ind + 1);
  if (opt[ind]) {
    ret += (long double)getKofN(ness[ind] + 1, arr[ind].size()) *
           get(cOpt + 1, ind + 1);
  }
  mem[cOpt][ind] = ret + 1;
  return ret;
}
int main() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long k;
    cin >> k;
    for (long long j = 0; j < k; j++) {
      long long crr;
      cin >> crr;
      arr[i].push_back(crr);
      all.push_back(crr);
    }
  }
  sort(all.begin(), all.end());
  int cOpt = 0;
  for (long long i = 0; i < m; i++) {
    for (long long j = 0; j < arr[i].size(); j++) {
      if (arr[i][j] == all[all.size() - n]) {
        opt[i]++;
      } else if (arr[i][j] > all[all.size() - n]) {
        ness[i]++;
      } else {
        notn[i]++;
      }
    }
    cOpt += opt[i];
    sumNess += ness[i];
  }
  cout << setprecision(20) << fixed << get(0, 0) * getKofN(n - sumNess, cOpt)
       << "\n";
  return 0;
}
