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 <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 1100000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
//const int mod = 1e9 + 7;
const int mod = 998244353;

ll GCD(ll a, ll b){
	if(b==0) return a;
	else return GCD(b,a%b);
}

int main(){
	ll n,m; cin >> n >> m;
	vl a(n); rep(i,n) cin >> a[i];
	vd p(n);
	rep(i,n){
		cin >> p[i];
		p[i] /= 100.0;
	}
	vl gc(1<<n,0);
	vl f(1<<n,0);
	rep(bit,1<<n){
		ll cnt = 0;
		rep(i,n){
			if(bit>>i & 1){
				cnt++;
			}
			else{
				ll nxt = bit | (1<<i);
				if(gc[bit] == m+1) gc[nxt] = m+1;
				else{
					ll g = GCD(gc[bit], a[i]);
					if(gc[bit] == 0) gc[nxt] = a[i];
					else if(gc[bit] / g > m / a[i]) gc[nxt] = m+1;
					else gc[nxt] = gc[bit] / g * a[i];
				}
			}
		}
		if(cnt == 0) f[bit] = 0;
		else if(cnt & 1) f[bit] = m / gc[bit];
		else f[bit] = - m / gc[bit];
	}
	rep(i,n){
		rep(bit,1<<n){
			if(bit>>i & 1) f[bit] += f[bit ^ (1<<i)];
		}
	}
	double ans = 0.0;
	rep(bit,1<<n){
		double pp = 1.0;
		rep(i,n){
			if(bit>>i & 1) pp *= p[i];
			else pp *= (1.0 - p[i]);
		}
		ans += pp * f[bit];
	}
	printf("%.10f\n",ans);
}