#include <bits/stdc++.h>
using namespace std;
const int max_n = 1005;
int n, m;
int sz[max_n];
int sel[max_n];
int val;
vector<pair<int, int> > gifts;
vector<int> names;
double dp[max_n][max_n];
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < (m); i++) {
    scanf("%d", &sz[i]);
    for (int j = 0; j < (sz[i]); j++) {
      scanf("%d", &val);
      gifts.push_back(make_pair(val, i));
    }
  }
  sort(gifts.begin(), gifts.end(), greater<pair<int, int> >());
  double p = 1.0;
  int l;
  for (int i = 0; i < (n); i++) {
    if (gifts[i].first == gifts[n - 1].first) {
      l = n - i;
      break;
    }
    int nm = gifts[i].second;
    p *= (sel[nm] + 1.0) / (sz[nm] - sel[nm]);
    sel[nm]++;
  }
  for (int i = 0; i < (gifts.size()); i++)
    if (gifts[i].first == gifts[n - 1].first) names.push_back(gifts[i].second);
  int s = names.size();
  for (int i = 0; i < (s + 1); i++) dp[i][0] = p;
  for (int i = (1); i <= (s); i++) {
    for (int j = (1); j <= (i); j++) {
      dp[i][j] =
          dp[i - 1][j - 1] *
          ((sel[names[i - 1]] + 1.0) / (sz[names[i - 1]] - sel[names[i - 1]])) *
          double(j) / double(i);
      dp[i][j] += dp[i - 1][j] * double(i - j) / double(i);
    }
  }
  printf("%.10lf\n", dp[s][l]);
  return 0;
}
