#include <bits/stdc++.h>
using namespace std;
long long const delta = 1000000007;
double a[(long long)1e3 + 8];
double b[(long long)1e3 + 8];
long long n;
double m;
bool check(double t) {
  double v = (double)(m + t) / (double)a[0];
  t -= v;
  if (t <= 0) return 0;
  for (long long i = 1; i < n; i++) {
    v = (double)(m + t) / (double)b[i];
    t -= v;
    if (t <= 0) return 0;
    v = (double)(m + t) / (double)a[i];
    t -= v;
    if (t <= 0) return 0;
  }
  v = (double)(m + t) / (double)b[0];
  t -= v;
  if (t <= 0) return 0;
  return 1;
}
int main() {
  std::ios::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  double l = 0.000001, r = (long long)1e9 + 8, mid;
  mid = (l + r) / 2;
  double ans = -1;
  while (r - l > 0.000001) {
    if (check(mid)) {
      r = mid;
      ans = r;
    } else
      l = mid;
    mid = (l + r) / 2;
  }
  cout.precision(10);
  if (check(l))
    ans = l;
  else if (check(r))
    ans = r;
  cout << fixed << ans;
  return 0;
}
