#include <bits/stdc++.h>
using namespace std;
const int inf = 1e3 + 9;
pair<long double, long double> a[inf];
int n, k;
bool check(long double x, long double w) {
  long double cur = x;
  cur = cur - (cur + w) / a[0].first;
  if (cur < 0) return false;
  for (int i = 1; i < n; i++) {
    cur = cur - (cur + w) / a[i].second;
    if (cur < 0) return false;
    cur = cur - (cur + w) / a[i].first;
    if (cur < 0) return false;
  }
  cur = cur - (cur + w) / a[0].second;
  if (cur < 0) return false;
  return true;
}
int main() {
  cin >> n >> k;
  bool in = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i].second;
  }
  if (in) cout << -1, exit(0);
  long double l = 0, r = 1e9 + 2, mid;
  while (r - l > 0.0000001) {
    mid = (r + l) / 2.0;
    if (check(mid, (long double)k))
      r = mid, in = 1;
    else
      l = mid;
  }
  long double v = 1e9;
  if (in == 0) cout << -1, exit(0);
  cout << fixed << setprecision(7) << r << endl;
}
