#include <bits/stdc++.h>
using namespace std;
const long double kc = (long double)1e-6;
long long n;
long double m, a[1010], b[1010];
long long check(long double k) {
  long double x = k;
  for (long long i = 1; i <= n; i++) {
    x -= (m + x) / a[i];
    if (x < 0) return 0;
    x -= (m + x) / b[i + 1];
    if (x < 0) return 0;
  }
  return 1;
}
signed main() {
  cout << setprecision(10) << fixed;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  b[n + 1] = b[1];
  long double dau = 0, cuoi = (long long)1e9 + 1;
  long double kq = -1;
  for (long long i = 1; i <= 300; i++) {
    long double giua = (dau + cuoi) / 2;
    if (check(giua) == 1) {
      cuoi = giua;
      kq = giua;
    } else {
      dau = giua;
    }
  }
  cout << kq;
}
