#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int n, m;
double ans = -1, a[N], b[N];
bool check(double x) {
  double cur = x;
  for (int i = 1; i <= n; i++) {
    double reqd = (cur + m) / a[i];
    cur -= reqd;
    int next_index = (i + 1) % n;
    if (!next_index) next_index = n;
    reqd = (cur + m) / b[next_index];
    cur -= reqd;
  }
  return cur >= 0;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  double low = 0, high = 10000000000;
  int limit = 1e4;
  while (low <= high and limit--) {
    double mid = low + (high - low) / 2;
    if (check(mid)) {
      ans = mid;
      high = mid - 0.000001;
    } else {
      low = mid + 0.000001;
    }
  }
  cout << setprecision(10) << ans << endl;
  return 0;
}
