#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long n;
bool check(double v, long long a[], long long b[], double w) {
  double x = v + w;
  for (long long i = 0; i < n; i++) {
    double temp = (double)x / a[i];
    x = x - temp;
    temp = (double)x / b[i + 1];
    x = x - temp;
  }
  if (x - w >= 0.000000) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double w;
  cin >> n >> w;
  long long a[n + 1], b[n + 1], i;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  a[n] = a[0];
  b[n] = b[0];
  cout << fixed << setprecision(10);
  double l = 0.000001, r = 1100000000.000000, ans = -1;
  while (l <= r) {
    double mid = l + (r - l) / 2;
    if (check(mid, a, b, w)) {
      r = mid - 0.000001;
      ans = mid;
    } else {
      l = mid + 0.000001;
    }
  }
  cout << ans;
}
