#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const int INFTY = 1e7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long N, M;
  cin >> N >> M;
  vector<long long> A(N), B(N);
  for (int i = 0; i < (N); i++) cin >> A[i];
  for (int i = 0; i < (N); i++) cin >> B[i];
  long double lo = 0, hi = 1e9 + 5;
  const long double EPS = 1e-10;
  long double ans = -1;
  while (EPS <= hi - lo) {
    long double mid = lo + (hi - lo) / 2;
    long double start = M + mid;
    for (int i = 0; i < N; i++) {
      start = start - start / A[i % N];
      start = start - start / B[(i + 1) % N];
    }
    if (start >= M) {
      ans = mid;
      hi = mid;
    } else {
      lo = mid;
    }
  }
  cout << fixed << setprecision(10) << ans << endl;
}
