#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1007;
long double sum[MAXN];
int n, m, cnt[MAXN], must[MAXN], may[MAXN], sum_may, sum_must;
long double dp[MAXN][MAXN];
vector<pair<int, int>> items;
long double comb(int n, int m) { return exp(-sum[n] + sum[n - m] + sum[m]); }
int main() {
  for (int i = 1; i < MAXN; i++) {
    sum[i] += sum[i - 1] + log(i);
  }
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> cnt[i];
    for (int j = 0; j < cnt[i]; j++) {
      cin >> x;
      items.push_back({x, i});
    }
  }
  sort(items.rbegin(), items.rend());
  int V = items[n - 1].first;
  for (auto &item : items) {
    if (item.first > V) {
      must[item.second]++;
      sum_must++;
    } else if (item.first == V) {
      may[item.second]++;
      sum_may++;
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i <= m; i++) {
    dp[i][0] = dp[i - 1][0] * comb(cnt[i], must[i]);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n - sum_must; j++) {
      if (may[i]) {
        dp[i][j] = dp[i - 1][j] * comb(cnt[i], must[i]) +
                   dp[i - 1][j - 1] * comb(cnt[i], must[i] + 1);
      } else {
        dp[i][j] = dp[i - 1][j] * comb(cnt[i], must[i]);
      }
    }
  }
  cout << setprecision(12) << dp[m][n - sum_must] * comb(sum_may, n - sum_must)
       << endl;
}
