#include <bits/stdc++.h>
using namespace std;
long long n;
double calc(double x, double y) { return x / y; }
bool check(long long *a, long long *b, double init, long long M) {
  for (int i = 0; i < n; ++i) {
    init -= calc(M + init, a[i]);
    if (init < 0) return false;
    init -= calc(M + init, b[(i + 1) % n]);
    if (init < 0) return false;
  }
  return true;
}
int main() {
  long long i, j, k, l, m, u, v, w, t, p;
  cin >> n >> m;
  long long arr1[n + 1], arr2[n + 1];
  for (i = 0; i < n; i++) cin >> arr1[i];
  for (j = 0; j < n; j++) cin >> arr2[j];
  double low = 0.00, high = 1000000001.000;
  double ans = -1;
  while (high - low > 0.000001) {
    double mid = (low + high) / 2;
    if (check(arr1, arr2, mid, m))
      high = mid, ans = mid;
    else
      low = mid;
  }
  printf("%.12f\n", ans);
}
