#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1000], b[1000];
bool check(long double x) {
  for (int i = 0; i < n; i++) {
    if (x * a[i] >= m + x)
      x -= (m + x) / (a[i] * 1.0);
    else
      return 0;
    if (x * b[i] >= m + x)
      x -= (m + x) / (b[i] * 1.0);
    else
      return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  long double l(0), r(1000000000);
  while (r - l > 0.00001) {
    long double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (check(r))
    cout << fixed << setprecision(7) << r << endl;
  else
    cout << "-1" << endl;
  return 0;
}
