Problem: Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n - 2 intermediate planets. Formally: we number all the planets from 1 to n. 1 is Earth, n is Mars. Natasha will make exactly n flights: 1 → 2 → … n → 1.

Flight from x to y consists of two phases: take-off from planet x and landing to planet y. This way, the overall itinerary of the trip will be: the 1-st planet → take-off from the 1-st planet → landing to the 2-nd planet → 2-nd planet → take-off from the 2-nd planet → … → landing to the n-th planet → the n-th planet → take-off from the n-th planet → landing to the 1-st planet → the 1-st planet.

The mass of the rocket together with all the useful cargo (but without fuel) is m tons. However, Natasha does not know how much fuel to load into the rocket. Unfortunately, fuel can only be loaded on Earth, so if the rocket runs out of fuel on some other planet, Natasha will not be able to return home. Fuel is needed to take-off from each planet and to land to each planet. It is known that 1 ton of fuel can lift off a_i tons of rocket from the i-th planet or to land b_i tons of rocket onto the i-th planet. 

For example, if the weight of rocket is 9 tons, weight of fuel is 3 tons and take-off coefficient is 8 (a_i = 8), then 1.5 tons of fuel will be burnt (since 1.5 ⋅ 8 = 9 + 3). The new weight of fuel after take-off will be 1.5 tons. 

Please note, that it is allowed to burn non-integral amount of fuel during take-off or landing, and the amount of initial fuel can be non-integral as well.

Help Natasha to calculate the minimum mass of fuel to load into the rocket. Note, that the rocket must spend fuel to carry both useful cargo and the fuel itself. However, it doesn't need to carry the fuel which has already been burnt. Assume, that the rocket takes off and lands instantly.

Input

The first line contains a single integer n (2 ≤ n ≤ 1000) — number of planets.

The second line contains the only integer m (1 ≤ m ≤ 1000) — weight of the payload.

The third line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 1000), where a_i is the number of tons, which can be lifted off by one ton of fuel.

The fourth line contains n integers b_1, b_2, …, b_n (1 ≤ b_i ≤ 1000), where b_i is the number of tons, which can be landed by one ton of fuel. 

It is guaranteed, that if Natasha can make a flight, then it takes no more than 10^9 tons of fuel.

Output

If Natasha can fly to Mars through (n - 2) planets and return to Earth, print the minimum mass of fuel (in tons) that Natasha should take. Otherwise, print a single number -1.

It is guaranteed, that if Natasha can make a flight, then it takes no more than 10^9 tons of fuel.

The answer will be considered correct if its absolute or relative error doesn't exceed 10^{-6}. Formally, let your answer be p, and the jury's answer be q. Your answer is considered correct if \frac{|p - q|}{max{(1, |q|)}} ≤ 10^{-6}.

Examples

Input

2
12
11 8
7 5


Output

10.0000000000


Input

3
1
1 4 1
2 5 3


Output

-1


Input

6
2
4 6 3 3 5 6
2 6 3 6 5 3


Output

85.4800000000

Note

Let's consider the first example.

Initially, the mass of a rocket with fuel is 22 tons.

  * At take-off from Earth one ton of fuel can lift off 11 tons of cargo, so to lift off 22 tons you need to burn 2 tons of fuel. Remaining weight of the rocket with fuel is 20 tons.
  * During landing on Mars, one ton of fuel can land 5 tons of cargo, so for landing 20 tons you will need to burn 4 tons of fuel. There will be 16 tons of the rocket with fuel remaining.
  * While taking off from Mars, one ton of fuel can raise 8 tons of cargo, so to lift off 16 tons you will need to burn 2 tons of fuel. There will be 14 tons of rocket with fuel after that.
  * During landing on Earth, one ton of fuel can land 7 tons of cargo, so for landing 14 tons you will need to burn 2 tons of fuel. Remaining weight is 12 tons, that is, a rocket without any fuel.



In the second case, the rocket will not be able even to take off from Earth.

Solution (in PYTHON3):

Solution:
"""for p in range(int(input())):

	n,k=map(int,input().split(" "))
	number=input().split(" ")
	chances=[k for i in range(n)]

	prev=-1
	prev_updated=-1
	last_used=False
	toSub=0
	start=0

	prevSub=0

	if(number[0]=='1'):
		prev=0
		prev_updated=0
		start=1

	for i in range(start,n):
		
		if(number[i]=='1'):
		#	print("\ni",i,"\ntoSub",toSub,"\nprevUpadted",prev_updated,"\nprev",prev,"\nlast_used",last_used)
			f1=False
#			toSub+=1
			toSub=0

			zeros=i - prev_updated - 1

			if(last_used):
				zeros-=1

			#chances[i]-=toSub

			#print(prevSub,(i - prev - 1 ) +1)
			if(i - prev - 1 <= prevSub):
				chances[i]-= prevSub - (i - prev - 1 ) +1
				if(chances[i]<zeros):
					chances[i]=zeros
				toSub+= prevSub - (i - prev - 1 ) +1
				f1=True

			if(zeros==0 or chances[i]==0):
				prev_updated=i
				prev=i
				last_used=False
				prevSub=toSub
				continue
		#	print("\nchances:  ",chances[i],"\t\tzeroes :   ",zeros,"\t\tprevSub :",prevSub)

			if(chances[i]>zeros):
		#		print("\t\t\t\t1")
				number[i-zeros]='1'
				number[i]='0'
				prev_updated=i-zeros
				last_used=False
			elif(chances[i]==zeros):
		#		print("\t\t\t\t2")
				number[i]='0'
				number[i-chances[i]]='1'
				prev_updated=i-chances[i]
				last_used=True
			else:
		#		print("\t\t\t\t3")
				number[i]='0'
				number[i-chances[i]]='1'
				prev_updated=i-chances[i]
				last_used=True
			prev=i

			prevSub=toSub

			if(prev_updated>2 and f1):
				if(number[prev_updated]=='1' and number[prev_updated-1]=='0' and number[prev_updated-2]=='1'):
					last_used=False
				#if()

		#	print("\ni",i,"\ntoSub",toSub,"\nprevUpadted",prev_updated,"\nprev",prev,"\nlast_used",last_used)
		#	print(number)
		else:
			toSub=0

	print(*number)
#	print(chances)"""

"""class offer:
	def __init__(self, n, fre):
		self.num = n
		self.free = fre
		self.delta= n-fre
		

n,m,k=map(int,input().split(" "))

shovel=list(map(int,input().split(" ")))

#dicti={}

offers=[]
temp_arr=[False for i in range(n)]

for i in range(m):
	p,q=map(int,input().split(" "))
	if(p>k):
		continue
	offers.append(offer(p,q))
#	dicti[p]=q

#for i in dicti:
#	dicti[i].sort()	

shovel.sort()
shovel=shovel[:k+1]

offers.sort(key=lambda x: x.delta/x.num,reverse=True)

bestoffer=[]

for i in offers:
	if(not temp_arr[i.num]):
		temp_arr[i.num]=True
		bestoffer.append(i)

cost=0

for i in bestoffer:
	
	
for p in range(int(input())):
	arr=list(input())

	n=len(arr)
	for i in range(n):
		arr[i]=ord(arr[i])-96

	arr.sort()

	arr1=arr[:n//2]
	arr2=arr[n//2:]
	arr=[]
	#print(arr,arr1,arr2)
	i1=n//2-1
	i2=n-i1-2

	while (i1!=-1 and i2!=-1):
		arr.append(arr1[i1])
		arr.append(arr2[i2])
		i1-=1
		i2-=1
	if(i1!=-1):
		arr.append(arr1[i1])
	elif(i2!=-1):
		arr.append(arr2[i2])

	#print(arr)

	s=""
	for i in range(n-1):
		if(abs(arr[i]-arr[i+1])==1):
			s=-1
			print("No answer")
			break
		else:
			s+=chr(arr[i]+96)

	if(s!=-1):
		s+=chr(arr[-1]+96)
		print(s)"""

"""
n,m=map(int,input().split(" "))

seti=[]
ans=[1 for i in range(n)]


for i in range(m):
	arr=list(map(int,input().split(" ")))
	
	if(arr[0]>1):
		seti.append(set(arr[1:]))
	else:
		m-=1

parent=[-1 for i in range(m)]
#print(seti)
for i in range(m-1):
	for j in range(i+1,m):
		if(parent[j]==-1):
			if(len(seti[i].intersection(seti[j]))>0):
				seti[i]=seti[i].union(seti[j])
				parent[j]=i

#print(parent)

for i in range(m):
	if(parent[i]==-1):
		temp=list(seti[i])
		store=len(temp)
		for j in temp:
			ans[j-1]=store

print(*ans)


for p in range(int(input())):
	arr=list(input())

	n=len(arr)
	for i in range(n):
		arr[i]=ord(arr[i])-96

	arr.sort()

	arr1=arr[:n//2]
	arr2=arr[n//2:]
	arr=[]
	#print(arr,arr1,arr2)
	i1=n//2-1
	i2=n-i1-2

	while (i1!=-1 and i2!=-1):
		arr.append(arr1[i1])
		arr.append(arr2[i2])
		i1-=1
		i2-=1
	if(i1!=-1):
		arr.append(arr1[i1])
	elif(i2!=-1):
		arr.append(arr2[i2])

	s=""
	for i in range(n-1):
		if(abs(arr[i]-arr[i+1])==1):
			s=-1
			print("No answer")
			break
		else:
			s+=chr(arr[i]+96)

	if(s!=-1):
		s+=chr(arr[-1]+96)
		print(s)
#n=0"""

n=int(input())
p=int(input())

arr1=list(map(int,input().split(" ")))
arr2=list(map(int,input().split(" ")))

a=1
flag=False
for i in range(n):
	a*=((arr1[i]-1)*(arr2[i]-1))/(arr1[i]*arr2[i])
	if(a==0):
		flag=True
		break

if(flag):
	print(-1)	
else:
	print(p*((1-a)/a))