#include <bits/stdc++.h>
using namespace std;
int n;
double base;
int a[1005], b[1005];
bool check(double c) {
  double now = base + c;
  for (int i = 1; i <= n; i++) {
    now -= now / a[i];
    now -= now / b[i + 1];
  }
  if (now - base < 0) return false;
  return true;
}
int main() {
  cin >> n;
  cin >> base;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  a[n + 1] = a[1];
  b[n + 1] = b[1];
  double L = 0, R = 2e9, res = -1;
  for (int i = 1; i <= 1000; i++) {
    double M = (R - L) / 2 + L;
    if (check(M)) {
      res = R = M;
    } else {
      L = M;
    }
  }
  printf("%.12f\n", res);
  return 0;
}
