#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  bool f = false;
  cin >> n >> m;
  double lift[n], land[n];
  for (int i = 0; i < n; i++) cin >> lift[i];
  for (int j = 0; j < n; j++) cin >> land[j];
  double start = 1, end = 1e9;
  while ((end - start) > 0.000001) {
    double mid = start + (end - start) / 2;
    bool flag = true;
    double temp = m + mid;
    double tfuel = 0;
    for (int i = 0; i < n; i++) {
      double liftfuel = temp / lift[i];
      tfuel += liftfuel;
      temp -= liftfuel;
      double landfuel = temp / land[i];
      tfuel += landfuel;
      temp -= landfuel;
      if (tfuel > mid) {
        flag = false;
        break;
      }
    }
    if (flag) {
      end = mid;
      f = true;
    } else
      start = mid;
  }
  if (f)
    printf("%0.7lf", end);
  else
    cout << -1;
}
