SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The probability of shooting the target each time is $\frac{a}{b}$ for SmallR while $\frac{c}{d}$ for Zanoes. The one who shoots in the target first should be the winner.

Output the probability that SmallR will win the match.


-----Input-----

A single line contains four integers $a, b, c, d(1 \leq a, b, c, d \leq 1000,0 < \frac{a}{b} < 1,0 < \frac{c}{d} < 1)$.


-----Output-----

Print a single real number, the probability that SmallR will win the match.

The answer will be considered correct if the absolute or relative error doesn't exceed 10^{ - 6}.


-----Examples-----
Input
1 2 1 2

Output
0.666666666667

Difficulty: interview

Starter code:

Solutions:
a, b, c, d = list(map(int, input().split()))
print((a * 1.0) / (b * (1 - ((d - c) * (b - a) * 1.0) / (d * b))))


a, b, c, d = list(map(int, input().split()))
p1 = a / b
p2 = c / d
print(p1 / (1 - (1 - p1) * (1 - p2)))


tmp = input().split(' ')
a = []
for i in range( 0 , 4 ):
    a.append( int( tmp[ i ] ) )

p1 = a[ 0 ] / a[ 1 ]
p2 = a[ 2 ] / a[ 3 ]

tot = 10 ** 5
ans = 0.0000000000000
for i in range( 0 , tot ):
    ans = ans + ( 1 - p1 ) ** i * ( 1 - p2 ) ** i * p1

print ( ans )


s=input().split()

a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

x=a/b
y=(1-x)*(c/d)

for i in range(10000):
    x+=(1-(x+y))*(a/b)
    y+=(1-(x+y))*(c/d)

print(x)


import math
import re
from fractions import Fraction
from collections import Counter

class Task:
    a, b, c, d = 0, 0, 0, 0
    answer = 0
    
    def __init__(self):
        self.a, self.b, self.c, self.d = [int(x) for x in input().split()]

    def solve(self):
        a, b, c, d = self.a, self.b, self.c, self.d
        p = a / b
        q = c / d
        x = (1 - p) * (1 - q)
        self.answer = p / (1 - x)

    def printAnswer(self):
        print(self.answer)

task = Task()
task.solve()
task.printAnswer()


l=input()
m=l.split(' ')
(a,b,c,d)=(int(m[0]),int(m[1]),int(m[2]),int(m[3]))
ans=1/(1+(b*c)/(a*d)-(c/d))
print(ans)


a,b,c,d = map(int,input().split())
print(a*d/(a*d+b*c-a*c))

ans = 0.0
p = 1.0
id = input().split()
a, b, c, d = int(id[0]), int(id[1]), int(id[2]), int(id[3])
for i in range( 100000 ):
	ans += p * a / b
	p *= (1.0 - a / b)
	p *= (1.0 - c / d)
print( ans )

##B
def main():
    a,b,c,d=list(map(int,input().split()))
    PA=a/b
    PB=c/d
    qA=1-PA
    qB=1-PB
    print(PA/(1-qA*qB))
main()


a, b, c, d = [int(x) for x in input().split()]
ans = a / b
ac = step = (b-a) / b * (d-c) / d
while ac > 1e-7:
 ans += a / b * ac
 ac *= step
print(ans)


a, b, c, d = list(map(int, input().split()))
p = a / b; q = c / d;
r = (1- p) * (1 - q);
print(p / (1 - r))


a, b, c, d = map(int, input().split())
print(a / b / (1 - (1 - a / b) * (1 - c / d)))

a,b,c,d = map(int,input().split())
q = (1-a/b)*(1-c/d)
print(a/b / (1-q))

def main():
    l=[int(x) for x in input().split(' ')]
    r=(l[0]*l[3])/(l[1]*l[2]+l[0]*l[3]-l[0]*l[2])
    print(r)
    
def __starting_point():
    main()

__starting_point()

I=list(input().split())
p1=(int(I[0]))/(int(I[1]))
p2=(int(I[2]))/(int(I[3]))
print(p1*(1/(1-(1-p1)*(1-p2))))


a, b, c, d = list(map(int, input().split()))
print("{0:.10f}".format(a / b / (1 - ((1 - a / b) * (1 - c / d)))))


import sys
a,b,c,d=list(map(int,input().split()))
s=0;p=1;i=1
while True:
    if i%2:
        s+=p*a/b
        p*=(1-a/b)
    else:
        p*=(1-c/d)
    if p<1e-7:
        print(round(s,6))
        return
    i=i+1


a,b,c,d = map(int,input().split())

print(a*d/(a*d+c*b-a*c))

3

a, b, c, d = tuple(map(int, input().split()))
print(1.0 * a * d / (b * d - (b - a) * (d - c)))


print("%.8f"%(lambda a,b,c,d:a/b/(1-(1-a/b)*(1-c/d)))(*list(map(int,input().split()))[0:4]))

a, b, c, d = map(int, input().split())
print(a / (b - (1 - c / d) * (b - a)))

import sys
import math
a,b,c,d = list(map(int,sys.stdin.readline().split()))
ans = 1 - (1 - a/b) * (1 - c/d)
ans = 1 / ans
ans = a / b * ans
print (ans)

a,b,c,d=list(map(int, input().split()))


z= (a/b)/(1-((1-(a/b))*(1-(c/d))))

print (z)


a,b,c,d=map(float,input().split())
t=(1-a/b)*(1-c/d)
print(a/b/(1-t))

a,b,c,d = input().split()
a,b,c,d = int(a),int(b),int(c),int(d)
print( "%.12f" % ((a/b)*( 1/( 1-(1-a/b)*(1-c/d) ) )) )