#include <bits/stdc++.h>
using namespace std;
int n, m;
long double incr[2005][2005];
vector<int> data[1005];
vector<pair<int, int> > v;
bool boss[1005];
int tot[1005];
int lst;
bool vis[1005][1005];
long double dp[1005][1005];
long double fun(int pos, int taken) {
  if (pos == m && taken == lst) return 1.0;
  if (pos == m && taken < lst) return 0.0;
  long double& ret = dp[pos][taken];
  if (vis[pos][taken]) return ret;
  vis[pos][taken] = 1;
  ret = 0.0;
  long double ret1 = 0.0, ret2 = 0.0;
  if (taken < lst && boss[pos]) ret1 = fun(pos + 1, taken + 1);
  ret2 = fun(pos + 1, taken);
  ret = ret1 * incr[data[pos].size()][tot[pos] + 1] +
        ret2 * incr[data[pos].size()][tot[pos]];
  return ret;
}
int main() {
  for (int i = 1; i <= 1000; i++) {
    incr[i][0] = 1.0;
    incr[i][i] = 1.0;
  }
  for (int i = 1; i <= 1000; i++) {
    for (int j = 1; j <= i; j++) {
      incr[j + i][j] = (incr[j - 1 + i][j - 1] * j * 1.0) / (j * 1.0 + i * 1.0);
      incr[j + i][j + i - j] = incr[j + i][j];
    }
  }
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int k;
    cin >> k;
    for (int j = 0; j < k; j++) {
      int x;
      cin >> x;
      data[i].push_back(x);
      v.push_back(make_pair(x, i));
    }
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int lstel = v[n - 1].first;
  lst = 0;
  for (int i = 0; v[i].first > lstel; i++) {
    tot[v[i].second]++;
    lst++;
  }
  lst = n - lst;
  int all = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first == lstel) {
      boss[v[i].second] = 1;
      all++;
    }
  }
  long double ans = 0;
  ans = fun(0, 0) * incr[all][lst];
  cout << fixed << setprecision(20) << ans << endl;
  return 0;
}
