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

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, m) = LI()
	a = LI()
	p = [c / 100.0 for c in LI()]
	d = collections.defaultdict(lambda : 1.0)
	e = collections.defaultdict(lambda : 1)
	r = 0
	for k in range(1, 1 << n):
		t = [i for i in range(n) if k & 1 << i]
		l = k & k - 1
		d[k] = d[l] * p[t[0]]
		e[k] = e[l] * a[t[0]] // fractions.gcd(a[t[0]], e[l])
		o = m // e[k]
		if len(t) % 2 == 1:
			r += o * d[k]
		else:
			r -= o * d[k]
	return '{:0.8f}'.format(r)
print(main())


def GCD(x, y):
	if y == 0:
		return x
	return GCD(y, x % y)

def CountBitFlag(T):
	T = (T & 1431655765) + (T >> 1 & 1431655765)
	T = (T & 858993459) + (T >> 2 & 858993459)
	T = (T & 252645135) + (T >> 4 & 252645135)
	T = (T & 16711935) + (T >> 8 & 16711935)
	T = (T & 65535) + (T >> 16 & 65535)
	return T
(N, M) = map(int, input().split())
A = tuple(map(int, input().split()))
P = tuple(map(int, input().split()))
Prob = [1.0] * (1 << N)
LCM = [1] * (1 << N)
ans = 0
for bit in range(1, 1 << N):
	top = (bit & -bit).bit_length() - 1
	l = bit & bit - 1
	Prob[bit] = Prob[l] * P[top] / 100
	LCM[bit] = LCM[l] // GCD(LCM[l], A[top]) * A[top]
	if CountBitFlag(bit) % 2 == 1:
		ans += M // LCM[bit] * Prob[bit]
	else:
		ans -= M // LCM[bit] * Prob[bit]
print('{:.8f}'.format(ans))


import sys
readline = sys.stdin.readline
write = sys.stdout.write

def solve():
	(N, M) = map(int, readline().split())
	(*A,) = map(int, readline().split())
	(*P,) = map(int, readline().split())

	def lcm(m, n):
		m0 = m
		n0 = n
		while n:
			(m, n) = (n, m % n)
		return m0 // m * n0
	N2 = 1 << N
	Q = [1] * N2
	L = [1] * N2
	C = [0] * N2
	for i in range(N):
		L[1 << i] = A[i]
		Q[1 << i] = P[i] / 100
	ans = 0
	for state in range(1, N2):
		b = state & -state
		L[state] = lcm(L[state ^ b], L[b])
		C[state] = C[state ^ b] + 1
		Q[state] = Q[state ^ b] * Q[b]
		if C[state] % 2:
			ans += Q[state] * (M // L[state])
		else:
			ans -= Q[state] * (M // L[state])
	write('%.16f\n' % ans)
solve()