#include <bits/stdc++.h>
using namespace std;
long long t, d, ct, q, ans, l, m, r, n, mx, mn, i, j, k, x, y, z, s;
char ch;
string ss = "", str = "";
map<long long, long long> mp;
set<long long> st;
long long a[200003], b[200003];
bool possible(long double d) {
  long double s = m * 1.00 + d;
  d -= s / b[0] * 1.00;
  if (d <= 0) return 0;
  for (i = 1; i < n; i++) {
    long double tot = m * 1.00 + d;
    long double q = tot / a[i] * 1.00;
    d -= q;
    if (d <= 0) return 0;
    tot = m * 1.00 + d;
    q = tot / b[i] * 1.00;
    d -= q;
    if (d <= 0) return 0;
  }
  d -= (m * 1.00 + d) / a[0] * 1.00;
  if (d <= 0) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  s = k = d = l = mx = m = mn = r = q = i = j = z = x = y = ct = ans = 0;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  long double dl, dr, res;
  dl = 1.000;
  dr = 1000000001.000000000;
  ans = -1.000;
  while (dr - dl >= 0.0000000001) {
    long double mid = (dl * 1.00 + dr * 1.00) / 2.00;
    if (possible(mid))
      ans = mid, dr = mid;
    else
      dl = mid;
  }
  if ((int)ans == -1)
    cout << -1;
  else
    cout << fixed << setprecision(10) << (dr + dl) / 2;
  return 0;
}
