#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
namespace Xrocks {}
using namespace Xrocks;
namespace Xrocks {
class in {
} user_input;
class out {
} output;
in& operator>>(in& X, int& Y) {
  scanf("%d", &Y);
  return X;
}
in& operator>>(in& X, char* Y) {
  scanf("%s", Y);
  return X;
}
in& operator>>(in& X, float& Y) {
  scanf("%f", &Y);
  return X;
}
in& operator>>(in& X, double& Y) {
  scanf("%lf", &Y);
  return X;
}
in& operator>>(in& X, char& C) {
  scanf("%c", &C);
  return X;
}
in& operator>>(in& X, string& Y) {
  cin >> Y;
  return X;
}
in& operator>>(in& X, long long& Y) {
  scanf("%lld", &Y);
  return X;
}
template <typename T>
in& operator>>(in& X, vector<T>& Y) {
  for (auto& x : Y) user_input >> x;
  return X;
}
template <typename T>
out& operator<<(out& X, const T& Y) {
  cout << Y;
  return X;
}
template <typename T>
out& operator<<(out& X, vector<T>& Y) {
  for (auto& x : Y) output << x << " ";
  return X;
}
out& operator<<(out& X, const int& Y) {
  printf("%d", Y);
  return X;
}
out& operator<<(out& X, const char& C) {
  printf("%c", C);
  return X;
}
out& operator<<(out& X, const string& Y) {
  printf("%s", Y.c_str());
  return X;
}
out& operator<<(out& X, const long long& Y) {
  printf("%lld", Y);
  return X;
}
out& operator<<(out& X, const float& Y) {
  printf("%f", Y);
  return X;
}
out& operator<<(out& X, const double& Y) {
  printf("%lf", Y);
  return X;
}
out& operator<<(out& X, const char Y[]) {
  printf("%s", Y);
  return X;
}
template <typename T>
T max(T A) {
  return A;
}
template <typename T, typename... args>
T max(T A, T B, args... S) {
  return max(A > B ? A : B, S...);
}
template <typename T>
T min(T A) {
  return A;
}
template <typename T, typename... args>
T min(T A, T B, args... S) {
  return min(A < B ? A : B, S...);
}
template <typename T>
void vectorize(int y, vector<T>& A) {
  A.resize(y);
}
template <typename T, typename... args>
void vectorize(int y, vector<T>& A, args&&... S) {
  A.resize(y);
  vectorize(y, S...);
}
long long fast(long long a, long long b, long long pr) {
  if (b == 0) return 1 % pr;
  long long ans = 1 % pr;
  while (b) {
    if (b & 1) ans = (ans * a) % pr;
    b >>= 1;
    a = (a * a) % pr;
  }
  return ans;
}
int readInt() {
  int n = 0;
  int ch = getchar_unlocked();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar_unlocked();
  n = n * sign;
  return n;
}
long long readLong() {
  long long n = 0;
  int ch = getchar_unlocked();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar_unlocked();
  n = n * sign;
  return n;
}
long long readBin() {
  long long n = 0;
  int ch = getchar_unlocked();
  int sign = 1;
  while (ch < '0' || ch > '1') {
    if (ch == '-') sign = -1;
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '1')
    n = (n << 1) + (ch - '0'), ch = getchar_unlocked();
  return n;
}
long long inv_(long long val,
               long long pr = static_cast<long long>(1000000007)) {
  return fast(val, pr - 2, pr);
}
}  // namespace Xrocks
long double dp[1001][1001];
class solve {
 public:
  solve() {
    int n, m;
    user_input >> n >> m;
    vector<int> w;
    vector<vector<int> > v(m);
    vector<int> sel(m), avail(m);
    for (int i = 0; i < m; i++) {
      int k;
      user_input >> k;
      for (int j = 0; j < k; j++) {
        int r;
        user_input >> r;
        w.push_back(r);
        v[i].push_back(r);
      }
    }
    for (auto& x : v) {
      sort(x.begin(), x.end());
      reverse(x.begin(), x.end());
    }
    sort(w.begin(), w.end());
    reverse(w.begin(), w.end());
    int Last = w[n - 1];
    long double ans = 0;
    for (int i = 0; i < m; i++) {
      for (auto& x : v[i]) {
        if (x > Last)
          ++sel[i];
        else if (x == Last)
          ++avail[i];
        else
          break;
      }
    }
    int Got = accumulate(sel.begin(), sel.end(), 0LL);
    int Targ = n - Got;
    vector<long double> Prob(m);
    ans = 1;
    int t = 0;
    for (int i = 0; i < m; i++) {
      long double d = 1;
      for (int j = 1; j <= sel[i]; j++) {
        d /= (v[i].size() - j + 1);
        d *= j;
      }
      Prob[i] = d;
      if (!avail[i]) {
        ans *= d;
      } else {
        Prob[t] = d;
        sel[t] = sel[i];
        v[t] = v[i];
        ++t;
      }
    }
    dp[0][0] = ans;
    for (int k = 0; k <= Targ; k++) {
      for (int i = max(1, k); i <= t; i++) {
        long double P = k;
        P /= i;
        long double P1 = k > 0 ? dp[i - 1][k - 1] * P : 0;
        long double P2 = dp[i - 1][k] * (1 - P);
        dp[i][k] =
            ((P1 / (v[i - 1].size() - sel[i - 1])) * (sel[i - 1] + 1) + P2) *
            Prob[i - 1];
      }
      output << "\n";
    }
    printf("%.10lf", double(dp[t][Targ]));
  }
};
int32_t main() {
  int t = 1, i = 1;
  if (0 || 0) scanf("%d", &t);
  while (t--) {
    if (0) printf("Case #%d: ", i++);
    new solve;
  }
  output << "\n";
  return 0;
}
