#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  double lift[n], land[n];
  for (int i = 0; i < (n); i++) cin >> lift[i] >> land[i];
  double ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans = (ans + m / land[(i + 1) % n]) / (1 - 1 / land[(i + 1) % n]);
    if (ans < 0 || ans > 1e9) return !(cout << -1);
    ans = (ans + m / lift[i]) / (1 - 1 / lift[i]);
    if (ans < 0 || ans > 1e9) return !(cout << -1);
  }
  cout << fixed << setprecision(7) << ans;
}
