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;

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

const ll INF=2e18;
const int MOD=1e9+7;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

ll gcd(ll a,ll b)
{
	return b?gcd(b,a%b):a;
}
ll lcm(ll a,ll b)
{
	if(a==INF || b==INF) return INF;
	if(a/gcd(a,b)>INF/b) return INF;
	return a/gcd(a,b)*b;
}

inline int clz(uint x)
{
	int i=0;
	if(!(x&0xffff0000)) i+=16,x<<=16;
	if(!(x&0xff000000)) i+=8,x<<=8;
	if(!(x&0xf0000000)) i+=4,x<<=4;
	if(!(x&0xc0000000)) i+=2,x<<=2;
	if(!(x&0x80000000)) i+=1,x<<=1;
	return i+!x;
}

template<typename T>
vector<T> Zeta(const vector<T>& g)
{
	int n=31-clz(g.size());
	vector<T> f=g;
	rep(i,n) rep(s,1<<n)
		if(s>>i&1) f[s]+=f[s^1<<i];
	return f;
}

template<typename T>
vector<T> Moebius(const vector<T>& f)
{
	int n=31-clz(f.size());
	vector<T> g=f;
	rep(i,n) rep(s,1<<n)
		if(s>>i&1) g[s]-=g[s^1<<i];
	return g;
}

int main()
{
	for(ll n,m;cin>>n>>m && n|m;){
		vl as(n);
		rep(i,n) cin>>as[i];
		vd ps(n);
		rep(i,n) cin>>ps[i],ps[i]/=100;
		
		// f(S): -1^|S| × (Sのどの要素でも割り切れる1<=x<=mの個数)
		// g(S): Sのいずれかの要素で割り切れる1<=x<=mの個数
		vl f(1<<n);
		repi(i,1,1<<n){
			ll l=1;
			rep(j,n) if(i>>j&1)
				l=lcm(l,as[j]);
			if(l==INF) continue;
			f[i]+=m/l;
		}
		vl g=Moebius(f);
		
		double res=0;
		repi(i,1,1<<n){
			double p=1;
			rep(j,n) p*=i>>j&1?ps[j]:1-ps[j];
			res+=p*abs(g[i]);
		}
		printf("%.10f\n",res);
	}
}