#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
const long double inf = 1e9 + 10;
bool use(long double &f, long double w, long double a);
int a[N], b[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> b[i];
  }
  b[n + 1] = b[1];
  long double lo = 0, hi = inf;
  for (int t = 0; t < 60; ++t) {
    long double mid = (lo + hi) / 2;
    long double f = mid;
    bool ok = true;
    for (int i = 1; i <= n; ++i) {
      if (!use(f, m, a[i])) {
        ok = false;
        break;
      }
      if (!use(f, m, b[i + 1])) {
        ok = false;
        break;
      }
    }
    if (ok) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  if (lo > 1e9) {
    cout << -1 << endl;
  } else {
    cout << fixed << setprecision(10) << lo << endl;
  }
}
bool use(long double &f, long double w, long double a) {
  if (f * a < f + w) {
    return false;
  }
  f -= (f + w) / a;
  return true;
}
