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:
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

int64_t gcd(int64_t a, int64_t b) {return b?gcd(b, a%b):a;}
int64_t lcm(int64_t a, int64_t b) {
    return (ll)min((ld)a/gcd(a,b)*b, (ld)2e18);
}
int64_t extgcd(int64_t a, int64_t b, int64_t &x, int64_t &y) { // ax+by=gcd(a, b)の解を与える
    int64_t d = a;
    if(b) {
        d = extgcd(b, a%b, y, x);
        y -= (a/b)*x;
    } else {
        x = 1; y = 0;
    }
    return d;
}
int main() {
    cout << fixed << setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    ll m;
    cin >> n >> m;
    vector<ll> a(n);
    vector<ld> p(n);
    rep(i, n) cin >> a[i];
    rep(j, n) {
        cin >> p[j];
        p[j] /= 100.0;
    }
    vector<ll> dp(1<<n);
    rep(bit, 1<<n) {
        if(!bit) continue;
        ll mul = 1;
        rep(i, n) if((bit>>i)&1) {
            mul = lcm(mul, a[i]);
        }
        dp[bit] = m/mul;
    }
    rep(i, n) rep(bit, 1<<n) {
        if(bit>>i & 1) dp[bit] -= dp[bit^(1<<i)];
    }
    ld ans = 0;
    rep(bit, 1<<n) {
        ld pr = 1;
        rep(j, n) {
            if(bit>>j&1) {
                pr *= p[j];
            } else {
                pr *= 1-p[j];
            }
        }
        ans += pr*abs(dp[bit]);
    }
    cout << ans << endl;
}