#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ld arr1[1005];
ld arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n;
	ld m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0, r = 1e9 + 5;
	for (ll i = 0; i < 200; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = ((fuel + m)/(arr1[0]));
		ll f = 0;
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		for (ll j = 1; j < n; j++) {
			req = ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
			req = ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
		}
		req = ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		if (f == 1)
			l = mid;
		else
			r = mid;
	}
	if (l > 1e9) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ld arr1[1005];
ld arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n;
	ld m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0, r = 1e9 + 5;
	for (ll i = 0; i < 200; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = ((fuel + m)/(arr1[0]));
		ll f = 0;
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		for (ll j = 1; j < n; j++) {
			req = ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
			req = ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
		}
		req = ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		if (f == 1)
			l = mid;
		else
			r = mid;
	}
	ld eps = 1e-6;
	if (l > 1e9 + eps) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ld arr1[1005];
ld arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n;
	ld m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld eps = 1e-6;
	ld l = 0, r = 1e9 + eps;
	for (ll i = 0; i < 200; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = ((fuel + m)/(arr1[0]));
		ll f = 0;
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		for (ll j = 1; j < n; j++) {
			req = ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
			req = ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
		}
		req = ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		if (f == 1)
			l = mid;
		else
			r = mid;
	}
	if (l > 1e9) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll arr1[1005];
ll arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n, m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0, r = 1e9;
	ll f = 0;
	for (ll i = 0; i < 10000; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = 1.0 * ((fuel + m)/(arr1[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		fuel = (ld)(fuel - req);
		for (ll j = 1; j < n; j++) {
			req = 1.0 * ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
			req = 1.0 * ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
		}
		req = 1.0 * ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		f = 1;
		r = mid;
	}
	if (f == 0) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ld arr1[1005];
ld arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n;
	ld m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0, r = 1e9;
	ll ch = 0;
	for (ll i = 0; i < 200; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = ((fuel + m)/(arr1[0]));
		ll f = 0;
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		for (ll j = 1; j < n; j++) {
			req = ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
			req = ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
		}
		req = ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		if (f == 1)
			l = mid;
		else {
			ch = 1;
			r = mid;
		}
	}
	if (ch == 0) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll arr1[1005];
ll arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n, m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0, r = 1e9;
	ll f = 0;
	for (ll i = 0; i < 1000; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = 1.0 * ((fuel + m)/(arr1[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		fuel = (ld)(fuel - req);
		for (ll j = 1; j < n; j++) {
			req = 1.0 * ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
			req = 1.0 * ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
		}
		req = 1.0 * ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		f = 1;
		r = mid;
	}
	if (f == 0) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll arr1[1005];
ll arr2[1005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n, m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = 0.00000000000000000000000001, r = 1e9;
	ll f = 0;
	for (ll i = 0; i < 500; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = 1.0 * ((fuel + m)/(arr1[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		fuel = (ld)(fuel - req);
		for (ll j = 1; j < n; j++) {
			req = 1.0 * ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
			req = 1.0 * ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				l = mid;
				continue;
			}
			fuel = (ld)(fuel - req);
		}
		req = 1.0 * ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			l = mid;
			continue;
		}
		f = 1;
		r = mid;
	}
	if (f == 0) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << l << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265358979323846264338327950L
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1)
    {
        cerr << name << " = " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args)
    {
        const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
        __f(comma+1, args...);
    }
#else
#define debug(...)
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
    return os << "[ " << p.first << ", " << p.second << "]" ;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ld arr1[1005];
ld arr2[1005];
ld eps = 1e-10;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll n;
	ld m;
	cin >> n >> m;
	for (ll i = 0; i < n; i++) {
		cin >> arr1[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> arr2[i];
	}
	ld l = eps, r = 1e9 + 5;
	for (ll i = 0; i < 200; i++) {
		ld mid = (l + r) / 2.0;
		ld fuel = mid;
		ld req = ((fuel + m)/(arr1[0]));
		ll f = 0;
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		for (ll j = 1; j < n; j++) {
			req = ((fuel + m)/(arr2[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
			req = ((fuel + m)/(arr1[j]));
			if (req > fuel) {
				f = 1;
				break;
			}
			fuel -= req;
		}
		req = ((fuel + m)/(arr2[0]));
		if (req > fuel) {
			f = 1;
		}
		fuel -= req;
		if (f == 1)
			l = mid;
		else
			r = mid;
	}
	if (l > 1e9 + eps) {
		cout << -1 << endl;
		return 0;
	}
	cout << fixed << setprecision(10);
	cout << r << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-7;
const int MAXN = 1e3 + 5;

int n, m, a[MAXN], b[MAXN];

bool check(double k) {
	for (int i = 2; i <= n+1; i++) {
		if (k < 0) return false;
		double qt = (m + k) / a[i-1];
		k -= qt;

		qt = (m + k) / b[(i-1)%n + 1];
		k -= qt;

		if (k < 0) return false;
	}

	return true;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", a+i);
	for (int i = 1; i <= n; i++) scanf("%d", b+i);

	int cnt = 500;

	double lo = 0, hi = 1e9, mi;
	bool ok = false;
	while(cnt--) {
		mi = (lo + hi) / 2;

		if (check(mi)) hi = mi, ok = true;
		else lo = mi;
	}

	if (!ok) printf("-1\n");
	else printf("%.7lf\n", hi);
}


#include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-9;
const int MAXN = 1e3 + 5;

int n, m, a[MAXN], b[MAXN];

bool check(double k) {
	for (int i = 2; i <= n+1; i++) {
		if (k < 0) return false;
		double qt = (m + k) / a[i-1];
		k -= qt;

		qt = (m + k) / b[(i-1)%n + 1];
		k -= qt;

		if (k < 0) return false;
	}

	return true;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", a+i);
	for (int i = 1; i <= n; i++) scanf("%d", b+i);

	double lo = 0, hi = 1e9, mi;
	while(lo + EPS < hi) {
		mi = (lo + hi) / 2;

		if (check(mi)) hi = mi;
		else lo = mi;
	}

	if (hi > 1e9) printf("-1\n");
	else printf("%.7lf\n", hi);
}


#include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-7;
const int MAXN = 1e3 + 5;

int n, m, a[MAXN], b[MAXN];

bool check(double k) {
	for (int i = 2; i <= n+1; i++) {
		if (k < 0) return false;
		double qt = (m + k) / a[i-1];
		k -= qt;

		qt = (m + k) / b[(i-1)%n + 1];
		k -= qt;

		if (k < 0) return false;
	}

	return true;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", a+i);
	for (int i = 1; i <= n; i++) scanf("%d", b+i);

	double lo = 0, hi = 1e10, mi;
	while(lo + EPS < hi) {
		mi = (lo + hi) / 2;

		if (check(mi)) hi = mi;
		else lo = mi;
	}

	if (hi > 1e9) printf("-1\n");
	else printf("%.7lf\n", hi);
}


#include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-9;
const int MAXN = 1e3 + 5;

int n, m, a[MAXN], b[MAXN];

bool check(double k) {
	for (int i = 2; i <= n+1; i++) {
		if (k < 0) return false;
		double qt = (m + k) / a[i-1];
		k -= qt;

		qt = (m + k) / b[(i-1)%n + 1];
		k -= qt;

		if (k < 0) return false;
	}

	return true;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", a+i);
	for (int i = 1; i <= n; i++) scanf("%d", b+i);

	double lo = 0, hi = 1e10, mi;
	bool ok = false;
	while(lo + EPS < hi) {
		mi = (lo + hi) / 2;

		if (check(mi)) hi = mi, ok = true;
		else lo = mi;
	}

	if (!ok) printf("-1\n");
	else printf("%.7lf\n", hi);
}


#include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-7;
const int MAXN = 1e3 + 5;

int n, m, a[MAXN], b[MAXN];

bool check(double k) {
	for (int i = 2; i <= n+1; i++) {
		if (k < 0) return false;
		double qt = (m + k) / a[i-1];
		k -= qt;

		qt = (m + k) / b[(i-1)%n + 1];
		k -= qt;

		if (k < 0) return false;
	}

	return true;
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", a+i);
	for (int i = 1; i <= n; i++) scanf("%d", b+i);

	int cnt = 500;

	double lo = 0, hi = 2e9, mi;
	bool ok = false;
	while(cnt--) {
		mi = (lo + hi) / 2;

		if (check(mi)) hi = mi, ok = true;
		else lo = mi;
	}

	if (!ok) printf("-1\n");
	else printf("%.7lf\n", hi);
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                if(mfu>mf) return false;
                else{
                       mf = mf - mfu;
                       mass = mr + mf;
                       mfu = (1/b[(i+1)%sz(a)])*mass;
                       if(mfu>mf) return false;
                       else{
                               mf = mf - mfu;
                               mass = mr+mf;
                       }
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 1e-9; ub = 1e9; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-9);
                        }else lb = mid + (1e-9);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans;
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                if(mfu>mf) return false;
                else{
                       mf = mf - mfu;
                       mass = mr + mf;
                       mfu = (1/b[(i+1)%sz(a)])*mass;
                       if(mfu>mf) return false;
                       else{
                               mf = mf - mfu;
                               mass = mr+mf;
                       }
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 1e-10; ub = 1e9; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-10);
                        }else lb = mid + (1e-10);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans<<" ";
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                if(mfu>mf) return false;
                else{
                       mf = mf - mfu;
                       mass = mr + mf;
                       mfu = (1/b[(i+1)%sz(a)])*mass;
                       if(mfu>mf) return false;
                       else{
                               mf = mf - mfu;
                               mass = mr+mf;
                       }
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 0; ub = 1e9+1; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-9);
                        }else lb = mid + (1e-9);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans<<" ";
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                mass = mass - mfu;
                if(mass<mr) return false;
                else{
                        mfu = (1/b[(i+1)%sz(a)])*mass;
                        mass = mass - mfu;
                        if(mass<mr) return false;
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 0; ub = 1e9; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-9);
                        }else lb = mid + (1e-9);
                }
                if(ans == 1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans;
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                if(mfu>mf) return false;
                else{
                       mf = mf - mfu;
                       mass = mr + mf;
                       mfu = (1/b[(i+1)%sz(a)])*mass;
                       if(mfu>mf) return false;
                       else{
                               mf = mf - mfu;
                               mass = mr+mf;
                       }
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 1e-10; ub = 1e9; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-10);
                        }else lb = mid + (1e-10);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans<<" ";
                cout<<1e-10;
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                if(mfu>mf) return false;
                else{
                       mf = mf - mfu;
                       mass = mr + mf;
                       mfu = (1/b[(i+1)%sz(a)])*mass;
                       if(mfu>mf) return false;
                       else{
                               mf = mf - mfu;
                               mass = mr+mf;
                       }
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 1e-10; ub = 1e10; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-10);
                        }else lb = mid + (1e-10);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans<<" ";
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                mass = mass - mfu;
                if(mass<mr) return false;
                else{
                        mfu = (1/b[(i+1)%sz(a)])*mass;
                        mass = mass - mfu;
                        if(mass<mr) return false;
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 0; ub = 1e18; ans=1e18;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-9);
                        }else lb = mid + (1e-9);
                }
                if(ans == 1e18) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans;
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 100005;
const ld pi = 3.141592653;
const ll MOD = 1000000007;

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

bool check (vector<ld> a, vector<ld> b, ld mf, ld mr)
{
        ld mass = mr+mf, mfu=0;
        ll i;
        for(i=0; i<sz(a); i++)
        {
                mfu = (1/a[i])*mass;
                mass = mass - mfu;
                if(mass<mr) return false;
                else{
                        mfu = (1/b[(i+1)%sz(a)])*mass;
                        mass = mass - mfu;
                        if(mass<mr) return false;
                }
        }
        return true;
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                ld n, m, ans, lb, ub;
                ll i;
                cin>>n>>m;
                vector<ld> a(n), b(n);
                for(i=0; i<n; i++) cin>>a[i];
                for(i=0; i<n; i++) cin>>b[i];
                lb = 1e-9; ub = 1e9; ans=1e10;
                while(lb<=ub)
                {
                        ld mid = (lb+ub)/2;
                        if(check(a, b, mid, m)){
                                ans = min(ans, mid);
                                ub = mid - (1e-9);
                        }else lb = mid + (1e-9);
                }
                if(ans==1e10) cout<<-1;
                else cout<<fixed<<setprecision(10)<<ans;
        }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	double k=1.0,s=0.0;
	for(int i=0;i<n;i++)
	{
		s+=k/a[i];
		k=k*(1-1.0/a[i]);
		s+=k/b[(i+1)%n];
		k=k*(1-1.0/b[(i+1)%n]);
	}
	if(k==1.0)
		{cout<<-1;return 0;}
	double ans=m*s/(1-s);
	if(ans<=0.0)
		{cout<<-1;return 0;}
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	double k=1.0,s=0.0;
	for(int i=0;i<n;i++)
	{
		s+=k/a[i];
		k=k*(1-1.0/a[i]);
		s+=k/b[(i+1)%n];
		k=k*(1-1.0/b[(i+1)%n]);
	}
	if(s==1.0)
		{cout<<-1;return 0;}
	double ans=m*s/(1-s);
	if(ans<=0.0)
		{cout<<-1;return 0;}
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	double k=1.0,s=0.0;
	for(int i=0;i<n;i++)
	{
		s+=k/a[i];
		k=k*(1-1.0/a[i]);
		s+=k/b[(i+1)%n];
		k=k*(1-1.0/b[(i+1)%n]);
	}
	if(s==1.0)
		{cout<<-1;return 0;}
	double ans=m*s/(1-s);
	if(ans<=0.0 || ans>1000000005.0)
		{cout<<-1;return 0;}
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	int f=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]==1)
			f=1;
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
		if(b[i]==1)
			f=1;
	}
	if(f==1)
		{cout<<-1;return 0;}
	double k=1.0,s=0.0;
	for(int i=0;i<n;i++)
	{
		s+=k/a[i];
		k=k*(1-1.0/a[i]);
		s+=k/b[(i+1)%n];
		k=k*(1-1.0/b[(i+1)%n]);
	}

	double ans=m*s/(1-s);
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	double k=1.0,s=0.0;
	for(int i=0;i<n;i++)
	{
		s+=k/a[i];
		k=k*(1-1.0/a[i]);
		s+=k/b[(i+1)%n];
		k=k*(1-1.0/b[(i+1)%n]);
	}
	if(s==1.0)
		{cout<<-1;return 0;}
	double ans=m*s/(1-s);
	if(ans<=0.0 || ans>1000000000.0)
		{cout<<-1;return 0;}
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;double m;
	cin>>n>>m;
	double a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	double k=1.0,z=1.0;
	for(int i=0;i<n;i++)
	{
		z=z*a[i]*b[i];
	}
	k=z;
	for(int i=0;i<n;i++)
	{
		k=k-k/a[n-1-i];
		k=k-k/b[n-1-i];
	}
	k=k/z;
	if(k<=0)
		{cout<<-1;return 0;}
	double ans=m*(1-k)/k;
	if(ans<=0.0)
		{cout<<-1;return 0;}
	cout<<fixed<<setprecision(6)<<ans;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool func(vector<double> &a, vector<double> &b, double fuel, double M)
{
	int N = a.size();
	for (int i = 1; i <= N; i++)
	{
		fuel -= (M + fuel) / a[i - 1];
		fuel -= (M + fuel) / b[i % N];
	}
	return fuel > 1e-9;
}

int main()
{
	int N;
	double M;
	cin >> N >> M;
	vector<double> a(N), b(N);
	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < N; i++)
	{
		cin >> b[i];
	}

	double ok = 0.0, ng = 0.0;
	for (double i = 0; i <= 1000; i += 0.25)
	{
		if (func(a, b, i, M))
			ok = i;
	}

	int cnt = 0;
	while (ok - ng > 1e-9 && cnt <= 500)
	{
		cnt++;
		double mid = (ok + ng) / 2;
		(func(a, b, mid, M) ? ok : ng) = mid;
	}

	set_digit(10);

	if (func(a, b, ok, M))
	{
		cout << ok << "\n";
	}
	else
	{
		cout << -1 << "\n";
	}
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool func(vector<long double> &a, vector<long double> &b, long double fuel, long double M)
{
	int N = a.size();
	for (int i = 1; i <= N; i++)
	{
		fuel -= (M + fuel) / a[i - 1];
		fuel -= (M + fuel) / b[i % N];
	}
	return fuel > 1e-12;
}

int main()
{
	int N;
	long double M;
	cin >> N >> M;
	vector<long double> 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 ok = inf, ng = 0.0;

	int cnt = 0;
	while (ok - ng > -1e-12 && cnt <= 400)
	{
		cnt++;
		long double mid = (ok + ng) / 2;
		(func(a, b, mid, M) ? ok : ng) = mid;
	}

	set_digit(10);

	if (func(a, b, ok, M))
	{
		cout << ok << "\n";
	}
	else
	{
		cout << -1 << "\n";
	}
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool func(vector<double> &a, vector<double> &b, double fuel, double M)
{
	int N = a.size();
	for (int i = 1; i <= N; i++)
	{
		fuel -= (M + fuel) / a[i - 1];
		fuel -= (M + fuel) / b[i % N];
	}
	return fuel > 0.0;
}

int main()
{
	int N;
	double M;
	cin >> N >> M;
	vector<double> a(N), b(N);
	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < N; i++)
	{
		cin >> b[i];
	}

	double ok = 0.0, ng = 0.0;
	for (double i = 0; i <= 1000; i += 0.25)
	{
		if (func(a, b, i, M))
			ok = i;
	}

	int cnt = 0;
	while (ok - ng > 1e-6 && cnt <= 300)
	{
		cnt++;
		double mid = (ok + ng) / 2;
		(func(a, b, mid, M) ? ok : ng) = mid;
	}

	set_digit(10);

	if (func(a, b, ok, M))
	{
		cout << ok << "\n";
	}
	else
	{
		cout << -1 << "\n";
	}
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool func(vector<long double> &a, vector<long double> &b, long double fuel, long double M)
{
	int N = a.size();
	for (int i = 1; i <= N; i++)
	{
		fuel -= (M + fuel) / a[i - 1];
		fuel -= (M + fuel) / b[i % N];
	}
	return fuel > 1e-12;
}

int main()
{
	int N;
	long double M;
	cin >> N >> M;
	vector<long double> 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 ok = 0.0, ng = 0.0;
	for (long double i = 0; i <= 1000; i += 0.25)
	{
		if (func(a, b, i, M))
			ok = i;
	}

	int cnt = 0;
	while (ok - ng > -1e-12 && cnt <= 500)
	{
		cnt++;
		long double mid = (ok + ng) / 2;
		(func(a, b, mid, M) ? ok : ng) = mid;
	}

	set_digit(10);

	if (func(a, b, ok, M))
	{
		cout << ok << "\n";
	}
	else
	{
		cout << -1 << "\n";
	}
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool func(vector<long double> &a, vector<long double> &b, long double fuel, long double M)
{
	int N = a.size();
	for (int i = 1; i <= N; i++)
	{
		fuel -= (M + fuel) / a[i - 1];
		fuel -= (M + fuel) / b[i % N];
	}
	return fuel > 1e-12;
}

int main()
{
	int N;
	long double M;
	cin >> N >> M;
	vector<long double> 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 ok = 0.0, ng = 0.0;
	for (long double i = 0; i <= 10000; i += 0.25)
	{
		if (func(a, b, i, M))
			ok = i;
	}

	int cnt = 0;
	while (ok - ng > -1e-12 && cnt <= 200)
	{
		cnt++;
		long double mid = (ok + ng) / 2;
		(func(a, b, mid, M) ? ok : ng) = mid;
	}

	set_digit(10);

	if (func(a, b, ok, M))
	{
		cout << ok << "\n";
	}
	else
	{
		cout << -1 << "\n";
	}
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 1010;

const double eps = 1e-10;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double payload = m, fuel = mid;
    for (int i = 1; i <= n; i++)
    {
        double fuel_req = (payload + fuel) / ai[i];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
        fuel_req = (payload + fuel) / bi[i % n + 1];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
    }
    return true;
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]);
    double l = 0, r = 1e9, res = -1;
    check(10);
    while (r - l > eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        printf("%.10lf\n", res);
    return 0;
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 101000;

const double eps = 2e-7;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double payload = m, fuel = mid;
    for (int i = 1; i <= n; i++)
    {
        double fuel_req = (payload + fuel) / ai[i];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
        fuel_req = (payload + fuel) / bi[i % n + 1];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
    }
    return true;
}

int main()
{
    bool flag = false;
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]), flag |= (ai[i] == 1);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]), flag |= (bi[i] == 1);
    if (flag)
        puts("-1"), exit(0);
    double l = eps, r = 1e9, res = -1;
    while (r - l > eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        printf("%.10lf\n", res);
    return 0;
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 101000;

const double eps = 1e-12;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double payload = m, fuel = mid;
    for (int i = 1; i <= n; i++)
    {
        double fuel_req = (payload + fuel) / ai[i];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
        fuel_req = (payload + fuel) / bi[i % n + 1];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
    }
    return true;
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]);
    double l = eps, r = 1e9, res = -1;
    while (r - l > eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        printf("%.10lf\n", res);
    return 0;
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 10100;

const double eps = 1e-8;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double payload = m, fuel = mid;
    for (int i = 1; i <= n; i++)
    {
        double fuel_req = (payload + fuel) / ai[i];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
        fuel_req = (payload + fuel) / bi[i % n + 1];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
    }
    return true;
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]);
    double l = 0, r = 1e9, res = -1;
    while (r - l > eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        printf("%.10lf\n", res);
    return 0;
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 101000;

const double eps = 1e-7;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double payload = m, fuel = mid;
    for (int i = 1; i <= n; i++)
    {
        double fuel_req = (payload + fuel) / ai[i];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
        fuel_req = (payload + fuel) / bi[i % n + 1];
        if (fuel < fuel_req)
            return false;
        fuel -= fuel_req;
    }
    return true;
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]);
    double l = 0, r = 1e9, res = -1;
    while (r - l > eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        printf("%.10lf\n", res);
    return 0;
}


// A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 101000;

const double eps = 2e-7;

int n, m, ai[MAX_N], bi[MAX_N];

bool check(double mid)
{
    double tot = m + mid;
    for (int i = 1; i <= n; i++)
    {
        tot -= tot / ai[i];
        if (tot < m && fabs(tot - m) > eps)
            return false;
        tot -= tot / bi[i % n + 1];
        if (tot < m && fabs(tot - m) > eps)
            return false;
    }
    return true;
}

int main()
{
    bool flag = false;
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]), flag |= (ai[i] == 1);
    for (int i = 1; i <= n; i++)
        scanf("%d", &bi[i]), flag |= (bi[i] == 1);
    if (flag)
        puts("-1"), exit(0);
    double l = eps, r = 1e9, res = -1;
    while (fabs(r - l) >= eps)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid, res = mid;
        else
            l = mid;
    }
    if (res == -1)
        puts("-1");
    else
        cout << fixed << setprecision(8) << res << endl;
    return 0;
}


////////////////////////////////////////////////Hello, a stupid reporting here//////////////////////////////////////////
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

ld n,m;
ld a[1000],b[1000];

bool check(ld x){
	ld res=m+x;
	for(ll i=0; i<n; i++){
		res-=res/a[i];
		res-=res/b[i];
		if(res<m) return false;
	}
	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	cin >> m;
	rep(i,0,n) cin >> a[i];
	rep(i,0,n) cin >> b[i];

	ld lo=0;
	ld hi=2e9;
	for(ll i=0; i<1000; i++){
		ld mid=(ld)(lo+hi)/2;
		//trace2(mid,check(mid));
		if(check(mid)) hi=mid;
		else lo=mid;
	}
	//trace2(lo,hi);
	if((ld)(lo+hi/2)<=2e9)cout << setprecision(20) << (ld)(lo+hi)/2;
	else cout << -1;
	return 0;
}
//* the exact constraints (multiple sets are too slow for n=10^6 :( )


////////////////////////////////////////////////Hello, a stupid reporting here//////////////////////////////////////////
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

ld n,m;
ld a[1000],b[1000];

bool check(ld x){
	ld res=m+x;
	for(ll i=0; i<n; i++){
		res-=res/a[i];
		res-=res/b[i];
		if(res<m) return false;
	}
	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	cin >> m;
	rep(i,0,n) cin >> a[i];
	rep(i,0,n) cin >> b[i];

	ld lo=0;
	ld hi=2e9;
	for(ll i=0; i<1000; i++){
		ld mid=(ld)(lo+hi)/2;
		//trace2(mid,check(mid));
		if(check(mid)) hi=mid;
		else lo=mid;
	}
	//trace2(lo,hi);
	if((ld)(lo+hi/2)<=1e9)cout << setprecision(0) << (ld)(lo+hi)/2;
	else cout << -1;
	return 0;
}
//* the exact constraints (multiple sets are too slow for n=10^6 :( )


////////////////////////////////////////////////Hello, a stupid reporting here//////////////////////////////////////////
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

ld n,m;
ld a[1000],b[1000];

bool check(ld x){
	ld res=m+x;
	for(ll i=0; i<n; i++){
		res-=res/a[i];
		res-=res/b[i];
		if(res<m) return false;
	}
	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	cin >> m;
	rep(i,0,n) cin >> a[i];
	rep(i,0,n) cin >> b[i];

	ld lo=0;
	ld hi=2e9;
	for(ll i=0; i<1000; i++){
		ld mid=(ld)(lo+hi)/2;
		//trace2(mid,check(mid));
		if(check(mid)) hi=mid;
		else lo=mid;
	}
	//trace2(lo,hi);
	if((ld)(lo+hi/2)<=2e9)cout << setprecision(10) << (ld)(lo+hi)/2;
	else cout << -1;
	return 0;
}
//* the exact constraints (multiple sets are too slow for n=10^6 :( )


////////////////////////////////////////////////Hello, a stupid reporting here//////////////////////////////////////////
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

ld n,m;
ld a[1000],b[1000];

bool check(ld x){
	ld res=m+x;
	for(ll i=0; i<n; i++){
		res-=res/a[i];
		res-=res/b[i];
		if(res<m) return false;
	}
	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	cin >> m;
	rep(i,0,n) cin >> a[i];
	rep(i,0,n) cin >> b[i];

	ld lo=0;
	ld hi=2e9;
	for(ll i=0; i<1000; i++){
		ld mid=(ld)(lo+hi)/2;
		//trace2(mid,check(mid));
		if(check(mid)) hi=mid;
		else lo=mid;
	}
	//trace2(lo,hi);
	if((ld)(lo+hi/2)<=1e9)cout << setprecision(10) << (ld)(lo+hi)/2;
	else cout << -1;
	return 0;
}
//* the exact constraints (multiple sets are too slow for n=10^6 :( )


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	double mid = (l + r) / 2;
	if (r - l < 0.000000001)
	{
		return l;
	}
	else
	{
		if (tr(mid))
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 1000000001.0);

	if (res > 1000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	k++;

	double mid = (l + r) / 2.0;

	if (k > 1000)
	{
		return mid;
	}

	if (r - l <= 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid)==1)
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 2000000001.0);

	if (res > 200000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	k++;

	double mid = (l + r) / 2.0;

	if (k > 1000)
	{
		return mid;
	}

	if (r - l <= 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid)==1)
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 2000000001.0);

	if (res > 2000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
long double m;
vector <long double> v1, v2;

int tr(long double v)
{
	long double sum = m + v, tv = v;
	/*tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}*/
	for (int i = 0; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
	}
	/*tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}*/

	return 1;
}

long double bin(long double l, long double r)
{
	k++;

	long double mid = (l + r) / 2.0;

	if (k > 10000)
	{
		return mid;
	}

	if (tr(mid) == 1)
	{
		return bin(l, mid);
	}
	else
	{
		return bin(mid, r);
	}
}

int main()
{
	fast;

	int i, j;
	long double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	long double res = bin(0.0, 2000000001.0);

	if (res > 2000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
long double m;
vector <long double> v1, v2;

int tr(long double v)
{
	long double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 1e-10)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 1e-10)
	{
		return 0;
	}

	return 1;
}

long double bin(long double l, long double r)
{
	k++;

	long double mid = (l + r) / 2.0;

	if (k > 10000)
	{
		return mid;
	}

	if (r - l <= 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid) == 1)
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	long double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	long double res = bin(0.0, 2000000001.0);

	if (res > 2000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	k++;
	if (k > 1000)
	{
		return 1000000001.0;
	}
	double mid = (l + r) / 2.0;
	if (r - l <= 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid)==1)
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 1000000001.0);

	if (res > 1000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	k++;

	double mid = (l + r) / 2.0;

	if (k > 1000)
	{
		return mid;
	}

	if (r - l <= 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid)==1)
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 1000000001.0);

	if (res > 1000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n, k;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	double mid = (l + r) / 2.0;
	if (r - l < 0.0000001)
	{
		return mid;
	}
	else
	{
		if (tr(mid))
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 1000000001.0);

	if (res > 1000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int n;
double m;
vector <double> v1, v2;

int tr(double v)
{
	double sum = m + v, tv = v;
	tv -= sum / v1[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}
	for (int i = 1; i < n; i++)
	{
		tv -= sum / v1[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
		tv -= sum / v2[i];
		sum = tv + m;
		if (tv < 0)
		{
			return 0;
		}
	}
	tv -= sum / v2[0];
	sum = tv + m;
	if (tv < 0)
	{
		return 0;
	}

	return 1;
}

double bin(double l, double r)
{
	double mid = (l + r) / 2.0;
	if (r - l < 0.0000001)
	{
		return l;
	}
	else
	{
		if (tr(mid))
		{
			return bin(l, mid);
		}
		else
		{
			return bin(mid, r);
		}
	}
}

int main()
{
	fast;

	int i, j;
	double l, r, a, b;

	cin >> n >> m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v1.push_back(a);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		v2.push_back(a);
	}

	double res = bin(0.0, 1000000001.0);

	if (res > 1000000000.0)
	{
		cout << -1;
	}
	else
	{
		cout.precision(7);
		cout << fixed << res;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD 1e9+7
#define MOD2 1e9+9
#define BIGMOD 1e17+7
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

bool isPrime(ll a)
{
	int i;
	for (i = 2; i*i <= a; i++)
	{
		if (a%i == 0)
		{
			return 0;
		}
	}
	return (a != 1);
}

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

int main()
{
	fast;

	int i, a, n;
	long double b, m, sm;

	cin >> n >> m;
	sm = m;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		if (a == 1)
		{
			cout << -1;

			return 0;
		}

		b = a;
		m *= b;
		m /= (b - 1);
	}
	for (i = 0; i < n; i++)
	{
		cin >> a;
		if (a == 1)
		{
			cout << -1;

			return 0;
		}

		b = a;
		m *= b;
		m /= (b - 1);
	}

	cout.precision(7);
	m -= sm;
	cout << fixed << m;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#include<string.h>
#define pi 3.1415926535897932384626433832795028841971
#define str_max_len 4294967295
#define mod 1000000007
#define max_ll LLONG_MAX
#define min_ll LLONG_MIN
#define cps CLOCKS_PER_SEC
#define pb push_back
#define fi first
#define se second
#define in insert
#define m_p make_pair
#define end "\n"
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};
ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
    if(y==0)return 1;
    ll a=power(x,y/2,m);
    if(y%2){
        return (a*((a*x)%m))%m;
    }
    else{
        return (a*a)%m;
    }
}
ll mod_inverse(ll x,ll m){
    return power(x,m-2,m);
}
ll fact(ll n,ll m){
    if(n<=1)return 1;
    return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
    if(r>n)return 0;
    ll n1=1,d1=1,d2=1;
    n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
    ll ans=mod_inverse((d1*d2)%m,m);
    ans=(ans*n1)%m;
    return ans;
}
int gcd(int a, int b){
    if (a < b)return gcd(b, a);
    if (a % b == 0) return b;
    return gcd(b,a % b);}

int ispal(string s){
    int len=s.size();
    int flag=1;
    for(int i=0;i<len;++i){
        if(s[i]!=s[len-i-1]){
            flag=0;break;
        }
    }
    return flag;
}

ll sroot(ll n,ll low=1,ll high=1e9+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid;
    if(a>n)return sroot(n,low,mid-1);
    else return sroot(n,mid,high);
}
ll croot(ll n,ll low=1,ll high=1e6+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid*mid;
    if(a>n)return croot(n,low,mid-1);
    else return croot(n,mid,high);

}

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

/***************************code begins here*****************************/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout<<fixed<<setprecision(10);

	int n;cin>>n;
	double w;cin>>w;
	double a[n];fo(i,n)cin>>a[i];
	double b[n];fo(i,n)cin>>b[i];

	double low=0.0,high=(mod-7)*1.00,mid;
	int k=0;
	double ans=high*1.00000;
	while(low<=high)
	{
		double mid=low+(high-low-0.0)/2.00;
		//cout<<mid<<" ";
		double fu=mid*1.0;

		fu-=((w+fu)*1.0)/(1.0*a[0]);
		ll cnt=0;

		if(fu>=0.0)
		{
			cnt=1;
			fo1(j,n-1)
			{
				fu-=((w+fu)*1.0)/(1.0*b[j]);
				if(fu<0.00)break;
				else cnt++;

				fu-=((w+fu)*1.0)/(1.0*a[j]);
				if(fu<0.00)break;
				else cnt++;
			}

			if(fu>=0.00)
			{
				fu-=((w+fu)*1.0)/(1.0*b[0]);
				if(fu>=0.00)cnt++;
			}
		}

		if(fu>=0.00)
		ans=min(ans,mid),high=mid-0.00000000001,k=1;
		else
		low=mid+0.00000000001;

	}
	if(k==0)cout<<"-1";
	else
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#include<string.h>
#define pi 3.1415926535897932384626433832795028841971
#define str_max_len 4294967295
#define mod 1000000007
#define max_ll LLONG_MAX
#define min_ll LLONG_MIN
#define cps CLOCKS_PER_SEC
#define pb push_back
#define fi first
#define se second
#define in insert
#define m_p make_pair
#define end "\n"
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};
ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
    if(y==0)return 1;
    ll a=power(x,y/2,m);
    if(y%2){
        return (a*((a*x)%m))%m;
    }
    else{
        return (a*a)%m;
    }
}
ll mod_inverse(ll x,ll m){
    return power(x,m-2,m);
}
ll fact(ll n,ll m){
    if(n<=1)return 1;
    return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
    if(r>n)return 0;
    ll n1=1,d1=1,d2=1;
    n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
    ll ans=mod_inverse((d1*d2)%m,m);
    ans=(ans*n1)%m;
    return ans;
}
int gcd(int a, int b){
    if (a < b)return gcd(b, a);
    if (a % b == 0) return b;
    return gcd(b,a % b);}

int ispal(string s){
    int len=s.size();
    int flag=1;
    for(int i=0;i<len;++i){
        if(s[i]!=s[len-i-1]){
            flag=0;break;
        }
    }
    return flag;
}

ll sroot(ll n,ll low=1,ll high=1e9+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid;
    if(a>n)return sroot(n,low,mid-1);
    else return sroot(n,mid,high);
}
ll croot(ll n,ll low=1,ll high=1e6+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid*mid;
    if(a>n)return croot(n,low,mid-1);
    else return croot(n,mid,high);

}

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

/***************************code begins here*****************************/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout<<fixed<<setprecision(10);

	int n;cin>>n;
	double w;cin>>w;
	double a[n];fo(i,n)cin>>a[i];
	double b[n];fo(i,n)cin>>b[i];

	double low=0.0,high=(mod-7)*1.00,mid;
	int k=0;
	double ans=high*1.00000;
	while(low<=high)
	{
		double mid=low+(high-low-0.0)/2.00;
		//cout<<mid<<" ";
		double fu=mid*1.0;

		fu-=((w+fu)*1.0)/(1.0*a[0]);
		ll cnt=0;

		if(fu>=0.0)
		{
			cnt=1;
			fo1(j,n-1)
			{
				fu-=((w+fu)*1.0)/(1.0*b[j]);
				if(fu<0.00)break;
				else cnt++;

				fu-=((w+fu)*1.0)/(1.0*a[j]);
				if(fu<0.00)break;
				else cnt++;
			}

			if(fu>=0.00)
			{
				fu-=((w+fu)*1.0)/(1.0*b[0]);
				if(fu>=0.00)cnt++;
			}
		}

		if(fu>=0.00)
		ans=min(ans,mid),high=mid-0.0000001,k=1;
		else
		low=mid+0.0000001;

	}
	if(k==0)cout<<"-1";
	else
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#include<string.h>
#define pi 3.1415926535897932384626433832795028841971
#define str_max_len 4294967295
#define mod 1000000007
#define max_ll LLONG_MAX
#define min_ll LLONG_MIN
#define cps CLOCKS_PER_SEC
#define pb push_back
#define fi first
#define se second
#define in insert
#define m_p make_pair
#define end "\n"
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);}
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};
ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
    if(y==0)return 1;
    ll a=power(x,y/2,m);
    if(y%2){
        return (a*((a*x)%m))%m;
    }
    else{
        return (a*a)%m;
    }
}
ll mod_inverse(ll x,ll m){
    return power(x,m-2,m);
}
ll fact(ll n,ll m){
    if(n<=1)return 1;
    return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
    if(r>n)return 0;
    ll n1=1,d1=1,d2=1;
    n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
    ll ans=mod_inverse((d1*d2)%m,m);
    ans=(ans*n1)%m;
    return ans;
}
int gcd(int a, int b){
    if (a < b)return gcd(b, a);
    if (a % b == 0) return b;
    return gcd(b,a % b);}

int ispal(string s){
    int len=s.size();
    int flag=1;
    for(int i=0;i<len;++i){
        if(s[i]!=s[len-i-1]){
            flag=0;break;
        }
    }
    return flag;
}

ll sroot(ll n,ll low=1,ll high=1e9+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid;
    if(a>n)return sroot(n,low,mid-1);
    else return sroot(n,mid,high);
}
ll croot(ll n,ll low=1,ll high=1e6+1){
    if(low==high)return low;
    if(low==high-1){
        if(high*high*high<=n)return high;
        else return low;
    }
    ll mid=(low+high)/2;
    ll a=mid*mid*mid;
    if(a>n)return croot(n,low,mid-1);
    else return croot(n,mid,high);

}

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

/***************************code begins here*****************************/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout<<fixed<<setprecision(10);

	int n;cin>>n;
	double w;cin>>w;
	double a[n];fo(i,n)cin>>a[i];
	double b[n];fo(i,n)cin>>b[i];

	double low=0.0,high=(mod-7)*1.00,mid;
	int k=0;
	double ans=high*1.00000;
	while(low<=high)
	{
		double mid=low+(high-low-0.0)/2.00;
		//cout<<mid<<" ";
		double fu=mid*1.0;

		fu-=((w+fu)*1.0)/(1.0*a[0]);
		ll cnt=0;

		if(fu>=0.0)
		{
			cnt=1;
			fo1(j,n-1)
			{
				fu-=((w+fu)*1.0)/(1.0*b[j]);
				if(fu<0.00)break;
				else cnt++;

				fu-=((w+fu)*1.0)/(1.0*a[j]);
				if(fu<0.00)break;
				else cnt++;
			}

			if(fu>=0.00)
			{
				fu-=((w+fu)*1.0)/(1.0*b[0]);
				if(fu>=0.00)cnt++;
			}
		}

		if(fu>=0.00)
		ans=min(ans,mid),high=mid-0.000001,k=1;
		else
		low=mid+0.000001;

	}
	if(k==0)cout<<"-1";
	else
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:25600000000000000000000000000000000")
#define qq cout << "!!" << endl;
#define ww cout << "??" << endl;
#define rr return 0;
#define nl cout << endl;
#define pb push_back
#define mk make_pair
#define sqr(a) ((a) * (a))
#define imp(a) fixed << setprecision(a)
#define x first
#define y second
#define acmSqrt(a) __asm__ ("fsqrt" : "+t" (a));

#define int ll

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pp;
typedef pair<double, double> point;

main() {
    ios_base::sync_with_stdio(0);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    int v1,v2,v3,vm;
    cin>>v1>>v2>>v3>>vm;
    if(vm>2*v3){
        cout<<-1;
        rr;
    }
    if(vm*2>=v2*2){
        cout<<-1;
        rr;
    }
    if(2*vm<v3){
        cout<<-1;
        rr;
    }
    cout<<v1*2<<endl;
    cout<<v2*2<<endl;
    cout<<v3;
    rr;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:25600000000000000000000000000000000")
#define qq cout << "!!" << endl;
#define ww cout << "??" << endl;
#define rr return 0;
#define nl cout << endl;
#define pb push_back
#define mk make_pair
#define sqr(a) ((a) * (a))
#define imp(a) fixed << setprecision(a)
#define x first
#define y second
#define acmSqrt(a) __asm__ ("fsqrt" : "+t" (a));

#define int ll

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pp;
typedef pair<double, double> point;

main() {
    ios_base::sync_with_stdio(0);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    int v1,v2,v3,vm;
    cin>>v1>>v2>>v3>>vm;
    if(vm>2*v3){
        cout<<-1;
        rr;
    }
    if(vm>=v2){
        cout<<-1;
        rr;
    }
    if(2*vm<v3){
        cout<<-1;
        rr;
    }
    cout<<v1*2<<endl;
    cout<<v2*2<<endl;
    cout<<max(v3,vm);
    rr;
}