Problem: Given n integers a1, a2,…, an and n integers p1, p2,…, pn, integer m. The operation of selecting the kth integer ak with a probability of pk [%] is performed for each k (1 ≤ k ≤ n), and 0 or more and n or less integers are selected. Find the expected number of integers between 1 and m that are divisible by at least one of the selected integers.

Constraints

* 1 ≤ n ≤ 20

* 1 ≤ m ≤ 1018

* 1 ≤ ak ≤ 1018 (1 ≤ k ≤ n)

* 1 ≤ pk ≤ 99 (1 ≤ k ≤ n)

Input

The input is given in the following format.

> n m
> a1 a2… an
> p1 p2… pn
>

Output

Print the solution to the problem on one line. The output must not have an absolute or relative error of more than 0.0000001 (= 10-7).

Examples

Input

2 15
3 5
50 50


Output

3.75


Input

4 100
2 3 5 7
80 60 40 20


Output

57.352


Input

4 210
2 3 5 7
80 60 40 20


Output

119.9136

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
ll A[20];
ld P[20];
ll mob[1 << 20];

ll gcd(ll a, ll b){
    ll r = a % b;
    while(r){
        a = b, b = r;
        r = a % b;
    }
    return b;
}

int main() {
    init();
    ld ans = 0;
    ll N, M;
    cin >> N >> M;
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> P[i], P[i] /= 100.0L;

    rep(bit, 1<<N){
        ll lc = 1;
        rep(i,N){
            if (!(bit >> i & 1)) continue;
            lc = (ll)min<ld>(M + 1, 1.0L * lc / gcd(lc, A[i]) * A[i]);
            if (lc == M + 1) break;
        }
        // err(bit, lc, M / lc);
        mob[bit] = M / lc;
    }
    
    rep(i,N)rep(bit,1<<N){
        if (bit >> i & 1) mob[bit] -= mob[bit ^ 1 << i];
    }

    rep(bit, 1<<N){
        ld p = 1;
        rep(i, N) p *= (bit >> i & 1 ? P[i] : 1.0L - P[i]);
        // err(p, mob[bit]);
        ans += p * (M - abs(mob[bit]));
    }

    cout << ans << endl;
}