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: EASY
Tags: Mathematics

Probability

Starter code:

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


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


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


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


(a, b, c, d) = map(int, input().split())
probablity = a / b
a1 = a / b
a2 = c / d
for i in range(1, 10000):
	probablity = probablity + (1 - a1) ** i * (1 - a2) ** i * a1
print(probablity)


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)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(a, b, c, d) = get_ints()
ans = a / b * (1 / (1 - (1 - a / b) * (1 - c / d)))
print(ans)


def main():
	args = input().split()
	a = int(args[0])
	b = int(args[1])
	c = int(args[2])
	d = int(args[3])
	p = a / b
	q = (1 - c / d) * (1 - a / b)
	print(p / (1 - q))
main()


def get_f_win_chance(f_num, f_denom, s_num, s_denom):
	f_hit_ch = f_num / f_denom
	s_hit_ch = s_num / s_denom
	f_win_ch = 0
	prob_remainder = 1
	while prob_remainder > 10 ** (-8):
		f_this_hit_win_ch = f_hit_ch * prob_remainder
		prob_remainder -= f_this_hit_win_ch
		f_win_ch += f_this_hit_win_ch
		s_this_hit_win_ch = s_hit_ch * prob_remainder
		prob_remainder -= s_this_hit_win_ch
	return f_win_ch
(f_num, f_denom, s_num, s_denom) = (int(x) for x in input().split())
print(get_f_win_chance(f_num, f_denom, s_num, s_denom))


(a, b, c, d) = map(int, input().split())
x = a / b
y = c / d
t = (1 - x) * (1 - y)
print(round(x / (1 - t), 10))


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


string = input()
input_list = string.split(' ')
a = int(input_list[0])
b = int(input_list[1])
c = int(input_list[2])
d = int(input_list[3])
smallR_hit = a / b
zanoes_hit = c / d
not_smallR_hit = 1 - smallR_hit
not_zanoes_hit = 1 - zanoes_hit
print(smallR_hit / (1 - not_smallR_hit * not_zanoes_hit))


(a, b, c, d) = map(int, input().split())
ans = 0
x = 1
for _ in range(100000):
	ans += x * a / b
	x = x * (b - a) / b * (d - c) / d
print(ans)


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


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


def gen(a, b):
	for i in range(10000):
		yield (a ** i * b ** i)
line = input().split(' ')
a = 1 - int(line[0]) / int(line[1])
b = 1 - int(line[2]) / int(line[3])
print(sum(gen(a, b)) * (1 - a))


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


import os
import sys
from io import BytesIO, IOBase
from typing import Union

def main():
	(a, b, c, d) = map(int, input().split())
	p = a / b
	x = (1 - p) * (1 - c / d)
	print(p / (1 - x))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(a, b, c, d) = [int(i) for i in input().split()]
probSmallR = a / b
probZanoes = c / d
resposta = probSmallR / (1 - (1 - probSmallR) * (1 - probZanoes))
print(round(resposta, 12))


(a, b, c, d) = map(int, input().split())
print('{:.15f}'.format(a * d / (-a * c + a * d + b * c)))


from math import *
(a, b, c, d) = map(int, input().split())
p = a / b
q = (1 - p) * (1 - c / d)
ans = p / (1 - q)
print(ans)


(a, b, c, d) = map(int, input().split())
p = a / b
g = (a / b - 1) * (c / d - 1)
print('%.20f' % (p / (1 - g)))


(q, w, e, r) = map(int, input().split(' '))
a = q / w / (1 - (w - q) * (r - e) / r / w)
print(a)


def main():
	data = list(map(int, input().split()))
	accuracy_prob = data[0] / data[1]
	lose_prob = (1 - accuracy_prob) * (1 - data[2] / data[3])
	archer_prob = accuracy_prob / (1 - lose_prob)
	print(format(archer_prob, '.15f'))
main()


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


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


y = list(map(int, input().strip().split()))[:4]
a = y[0] / y[1]
b = y[2] / y[3]
print('{:.12f}'.format(a / (1 - (1 - a) * (1 - b))))


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


x = list(map(int, input().split()))
print(round(x[0] / x[1] / (1 - (1 - x[2] / x[3]) * (1 - x[0] / x[1])), 6))


def luchniki(a, b, c, d):
	result = a / b / (1 - (1 - a / b) * (1 - c / d))
	return '{0:.12f}'.format(result)
(A, B, C, D) = [int(i) for i in input().split()]
print(luchniki(A, B, C, D))


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


def main():
	txt = input()
	txt = txt.split()
	a = float(txt[0])
	b = float(txt[1])
	c = float(txt[2])
	d = float(txt[3])
	x = a / b
	y = c / d
	q = (1 - x) * (1 - y)
	p = x / (1 - q)
	print(f'{p:.10}')
main()


(a, b, c, d) = map(int, input().split())
x = a / b
y = c / d
ans = 0
for i in range(1000000):
	ans += x * pow(1 - x, i) * pow(1 - y, i)
print('%.9f' % ans)


(a, b, c, d) = [int(x) for x in input().split()]
p1 = 1 - a / b
p2 = 1 - c / d
p = a / b / (1 - p1 * p2)
print(p)


(a, b, c, d) = map(int, input().split())
n = 10 ** 6
s = a / b
prev_term = a / b
for i in range(n):
	prev_term *= (b - a) / b * ((d - c) / d)
	s += prev_term
print(s)


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


a = [int(x) for x in input().split()]
print(a[0] / a[1] / (1 - (1 - a[2] / a[3]) * (1 - a[0] / a[1])))


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


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


(a, b, c, d) = [int(i) for i in input().split()]
chanceSRacertar = a / b
chanceZacertar = c / d
chanceSRerrar = 1 - chanceSRacertar
chanceZerrar = 1 - chanceZacertar
probabilidadeSRvencer = chanceSRacertar / (1 - chanceSRerrar * chanceZerrar)
print(probabilidadeSRvencer)


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-07:
		print(round(s, 6))
		return
	i = i + 1


def prob():
	n = input().split()
	arc = float(n[0]) / float(n[1])
	zan = float(n[2]) / float(n[3])
	return arc * (1 / (1 - (1 - arc) * (1 - zan)))
print(prob())


from math import *
arr = list(map(int, input().split()))
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]
q = (b - a) * (d - c) / (b * d)
print(a / b / (1 - q))


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


(a, b, c, d) = [int(u) for u in input().split()]
p = a / b
q = c / d
W = p / (1 - (1 - p) * (1 - q))
print(W)


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


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


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


nums = [int(tok) for tok in input().split(' ')]
(a, b, c, d) = nums
print(a * d / (a * d + b * c - a * c))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]
(a, b, c, d) = value()
p = Fraction(a, b)
q = Fraction(c, d)
ans = p / (1 - (1 - p) * (1 - q))
print(float(ans))


def main(args):
	n = list(map(int, input().split(' ')))
	a = n[0]
	b = n[1]
	c = n[2]
	d = n[3]
	print(a * d / (a * d + c * (b - a)))
import sys
sys.exit(main(sys.argv))


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


def solve():
	(a, b, c, d) = map(int, input().split())
	p = a / b
	q = c / d
	ans = p * (1 / (1 - (1 - p) * (1 - q)))
	print(ans)
	return

def main():
	t = 1
	for _ in range(t):
		solve()
main()


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


import math
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
(a, b, c, d) = M()
print(a * d / (a * d + b * c - a * c))


def main():
	(a, b, c, d) = [int(i) for i in input().split()]
	answer = a / b * 1 / (1 - (1 - a / b) * (1 - c / d))
	print(answer)
main()


n = input().split()
a = float(n[0])
b = float(n[1])
c = float(n[2])
d = float(n[3])
print(a / b / (a / b + c / d - a / b * (c / d)))


(a, b, c, d) = map(float, input().split())
ans = a / b
q = (1 - a / b) * (1 - c / d) * (a / b)
for i in range(500000):
	ans += q
	q = q * (1 - a / b) * (1 - c / d)
print('%.10f' % ans)


import math
inp = lambda cast=int: [cast(x) for x in input().split()]
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(a, b, c, d) = inp()
(nr, dr) = (a * d, b * d - (b - a) * (d - c))
printf('{:.12f}', nr / dr)


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


(a, b, c, d) = list(map(int, input().split()))
awin = a / b
aloss = 1 - a / b
bloss = 1 - c / d
ans = awin * (1 / (1 - aloss * bloss))
print('%.12f' % ans)


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.0
for i in range(0, tot):
	ans = ans + (1 - p1) ** i * (1 - p2) ** i * p1
print(ans)


(a, b, c, d) = list(map(int, input().split()))
ans = a / b
x = 1 - a / b
y = 1 - c / d
ans /= 1 - x * y
print('%.10f' % ans)


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
(a, b, c, d) = iia()
p = a / b
q = (1 - c / d) * (1 - a / b)
print(p / (1 - q))


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


(a, b, c, d) = list(map(int, input().split()))
nu = a * d
de = b * c + a * d - a * c
ans = nu / de
print(float(ans))


(a, b, c, d) = list(map(int, input().split()))
R = a / b
Z = c / d
final = 0
p_atual = 1
for i in range(10000):
	final += p_atual * (1 - R) * Z
	p_atual = p_atual * (1 - R) * (1 - Z)
print(1 - final)


from sys import stdin, stdout, stderr
import time, math
from collections import defaultdict as dd

def pn(ob):
	stdout.write(str(ob))

def inp():
	return stdin.readline()

def process():
	(a, b, c, d) = map(int, input().split())
	_s = 1 - a / b
	_z = 1 - c / d
	s = a / b
	p = _s * _z
	res = 1 / (1 - p)
	res = s * res
	print(res)

def main():
	t = 1
	start = time.time()
	while t > 0:
		t -= 1
		process()
	end = time.time()
main()


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


import sys
input = sys.stdin.readline
(a, b, c, d) = map(int, input().split())
p = a / b
q = (1 - a / b) * (1 - c / d)
print(p / (1 - q))


def main():
	(a, b, c, d) = map(float, input().split(' '))
	x = 1 - c / d - a / b + a * c / (b * d)
	return -a / b / (x - 1)
print('{}'.format(main()))


(a, b, c, d) = [int(x) for x in input().split()]
p_smallR = a / b
p_zanoes = c / d
trials = 100000
smallR_wins = 0
zanoes_wins = 0
cur_prob = 0
for n in range(trials):
	cur_prob += p_smallR * ((1 - p_smallR) * (1 - p_zanoes)) ** n
print(cur_prob)


(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-07:
	ans += a / b * ac
	ac *= step
print(ans)


from math import *
import sys
input = sys.stdin.readline
global flag

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = 1
while t:
	t -= 1
	(a, b, c, d) = ma()
	r = a / b
	de = 1 - (1 - a / b) * (1 - c / d)
	print(r / de)


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) = list(map(int, input().split()))
u0 = a / b
q = (1 - a / b) * (1 - c / d)
print(u0 * (1 / (1 - q)))


n = list(input().split())
a = int(n[0])
b = int(n[1])
c = int(n[2])
d = int(n[3])
p1 = a / b
q1 = (b - a) / b
q2 = (d - c) / d
s = p1 * (1 / (1 - q1 * q2))
print(s)


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
p = a / b
q = (1 - a / b) * (1 - c / d)
ans = p / (1 - q)
print('{:.10f}'.format(ans))


import sys
(a, b, c, d) = [float(x) for x in sys.stdin.readline().strip().split(' ')]
f = (1 - a / b) * (1 - c / d)
ans = a / b * (1 / (1 - f))
print(ans)


arr = input().split()
for i in range(4):
	arr[i] = int(arr[i])
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]
print(a * d / (a * d + c * b - a * c))


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) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
s = a / b
p = (1 - a / b) * (1 - c / d)
n = s * (1 / (1 - p))
print(n)


(w1, w2, w3, w4) = [int(i) for i in input().split()]
print(w1 * w4 / (w1 * w4 + w2 * w3 - w3 * w1))


(a, b, c, d) = map(int, input().split())
r = a / b
rBar = 1 - r
zBar = 1 - c / d
ans = r
term = r
while term > 1e-11:
	term *= rBar * zBar
	ans += term
print(ans)


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


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


(a, b, c, d) = [int(x) for x in input().split()]
p1 = a / b
p2 = c / d
p = p1 / (1 - (1 - p1) * (1 - p2))
print('{:.10f}'.format(round(p, 10)))


(a, b, c, d) = map(int, input().split(' '))
prob = 0
x = 0
v1 = (b - a) * (d - c) / (b * d)
while True:
	tmp = pow(v1, x)
	tmp *= a / b
	if tmp < 1e-10:
		print(prob)
		break
	prob += tmp
	x += 1


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


(a, b, c, d) = map(int, input().split())
x = a / b
y = c / d
xx = 1 - x
yy = 1 - y
f = x / (1 - xx * yy)
print(f)


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
x = a / b
y = 0
for i in range(100000):
	y += (1 - (x + y)) * c / d
	x += (1 - (x + y)) * a / b
print(x)


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


(a, b, c, d) = [int(x) for x in input().split()]
p = float(a / b)
q = float(c / d)
x = p / (p + q - p * q)
print('%.12f' % x)


(a, b, c, d) = map(int, input().split())
pA = a / b
pB = c / d
mul = (1 - pA) * (1 - pB)
res = pA
for i in range(1, 10000):
	res += pow(mul, i) * pA
print(res)


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


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
(a, b, c, d) = RI()
ans = a / b * 1 / (1 - (1 - a / b) * (1 - c / d))
print(ans)


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) = map(int, input().split())
first = a / b
r = (1 - a / b) * (1 - c / d)
print(first / (1 - r))


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)


(a, b, c, d) = [int(x) for x in input().split()]
prob = a / b / (1 - (1 - a / b) * (1 - c / d))
print(prob)


(a, b, c, d) = [int(i) for i in input().split()]
probs = a / b
nprobs = 1 - probs
probz = 1 - c / d
currentp = probs
accum = probs
oldp = 0
while currentp - oldp > 1e-09:
	oldp = currentp
	accum *= nprobs * probz
	currentp += accum
print(currentp)


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


from sys import stdin, stdout
from os import path
rd = lambda : stdin.readline().strip()
wr = stdout.write
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
import time, math
(a, b, c, d) = map(int, rd().split())
print(a / b / (1 - (1 - a / b) * (1 - c / d)))


import sys
import bisect
from collections import Counter, defaultdict as dd

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def strl():
	return list(strsp())

def sp():
	return map(int, data().split())

def strsp():
	return map(str, data().split())
(a, b, c, d) = sp()
p = a / b
q = (1 - a / b) * (1 - c / d)
print(p / (1 - q))


[a, b, c, d] = list(map(float, input().split()))
al = a / b
be = c / d
de = (1 - al) * (1 - be)
print(al / (1 - de))


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


(a, b, c, d) = [int(i) for i in input().split()]
prob1 = a / b
prob2 = c / d
probDoisErrarem = (1 - prob1) * (1 - prob2)
prob1Ganhar = prob1 / (1 - probDoisErrarem)
print(prob1Ganhar)


(a, b, c, d) = input().strip().split(' ')
p1 = int(a) / int(b)
p2 = int(c) / int(d)
p = (1 - p1) * (1 - p2)
ans = p1 / (1 - p)
print(ans)


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


a = input().split(' ')
p = int(a[0])
q = int(a[1])
r = int(a[2])
s = int(a[3])
a = p / q
b = r / s
a = 1 - a
b = 1 - b
x = a * b
x = 1 - x
x = 1 / x
a = p / q
x = x * a
print(x)


entrada = input()
itens = entrada.split()
(a, b, c, d) = (float(itens[0]), int(itens[1]), int(itens[2]), int(itens[3]))
prob_win_sr = a / b
prob_win_zn = c / d
prob_failure = (1 - prob_win_sr) * (1 - prob_win_zn)
result = prob_win_sr / (1 - prob_failure)
print(result)


(x, y, z, w) = map(int, input().split())
q = 1 - (1 - x / y) * (1 - z / w)
print(x / y / q)


def main():
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	c = inp[2]
	d = inp[3]
	prob_small_r_win = a / b
	prob_zanoes_win = c / d
	prob_both_lose = (1 - prob_small_r_win) * (1 - prob_zanoes_win)
	print(round(prob_small_r_win / (1 - prob_both_lose), 12))
main()


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


(a, b, c, d) = [int(i) for i in input().split(' ')]
m = a / b
n = 1 - (1 - a / b) * (1 - c / d)
print(m / n)


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


entrada = [float(x) for x in input().split()]
num1 = entrada[0] / entrada[1]
num2 = entrada[2] / entrada[3]
print('%.12f' % (num1 / (num1 + num2 - num1 * num2)))


s = input()
s = s.split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
p1 = a / b
p2 = c / d
q = (1 - p1) * (1 - p2)
print(p1 / (1 - q))


[a, b, c, d] = [int(x) for x in input().split()]
print(a * d / (b * c + a * d - a * c))


(a, b, c, d) = [int(x) for x in input().split()]
p = a / b
p_ = 1 - p
q_ = 1 - c / d
total = 0
n = 10 ** 6
for i in range(n):
	total += (p_ * q_) ** i * p
print(total)


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


a = input().split()
r1 = int(a[0]) / int(a[1])
r2 = int(a[2]) / int(a[3])
q = (1 - r1) * (1 - r2)
s = (1 - q ** 10000) / (1 - q)
print(r1 * s)


(a, b, c, d) = list(map(int, input().split()))
b1 = a / b
q = (1 - b1) * (1 - c / d)
n = 10000
res = b1 * (q ** n - 1) / (q - 1)
print(res)


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()


import sys
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
(a, b, e, d) = sp()
(p1, p2) = (a / b, e / d)
(t1, t2) = (1.0 - p1, 1.0 - p2)
ans = p1 / (1 - t1 * t2)
print('%.6f' % ans)


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


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


from decimal import Decimal
(a, b, c, d) = map(Decimal, input().split())
previous = -1
current = 0
i = 0
q = a / b
r = c / d
while abs(current - previous) > 1e-09:
	previous = current
	current += q * ((1 - r) * (1 - q)) ** i
	i += 1
print(current)


import sys
entrada = input().split()
a = int(entrada[0])
b = int(entrada[1])
c = int(entrada[2])
d = int(entrada[3])
print(a / b / (1 - (1 - a / b) * (1 - c / d)))


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


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


(a, b, c, d) = [int(i) for i in input().split()]
p1 = a / b
p2 = c / d
awns = p1 / (1 - (1 - p1) * (1 - p2))
print(awns)


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()


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


from typing import List

def parse_input() -> List[int]:
	return [int(x) for x in input().split()]

def solve(a: int, b: int, c: int, d: int) -> float:
	p = a / b
	q = c / d
	return p / (p + q - q * p)
(a, b, c, d) = parse_input()
print(solve(a, b, c, d))


(a, b, c, d) = input().strip().split(' ')
(a, b, c, d) = [int(a), int(b), int(c), int(d)]
p = a / b
q = (1 - a / b) * (1 - c / d)
ans = p / (1 - q)
print(ans)


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


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


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


(a, b, c, d) = list(map(int, input().split()))
a_win = a / b
b_loose = 1 - c / d
a_loose = 1 - a_win
result = a_win / (1 - a_loose * b_loose)
print(result)


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


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
ans = 0

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = 1
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		[a, b, c, d] = inlt()
		print(abs(a / b * (1 / (1 - (1 - a / b) * (1 - c / d)))))
main()


(a, b, c, d) = map(int, input().split())
x = (b - a) * (d - c)
y = d * b
n = 10000
p = (pow(x, n) - pow(y, n)) * a
q = (x * pow(y, n - 1) - pow(y, n)) * b
print(p / q)


from collections import Counter, defaultdict, deque
import sys
input = sys.stdin.readline

def solve():
	(a, b, c, d) = [int(x) for x in input().split()]
	p1 = a / b
	p2 = c / d
	p = p1 / (1 - (1 - p1) * (1 - p2))
	print(p)
tt = 1
for test in range(tt):
	solve()


(a, b, c, d) = map(int, input().split())
x = a / b
y = c / d
s = 0
for i in range(10000):
	if i == 0:
		s += x
	else:
		s += (1 - x) ** i * (1 - y) ** i * x
print(s)


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


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


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


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)
import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
S = lambda : list(map(str, input().split()))
(a, b, c, d) = I()
sum1 = a / b
sum2 = a / b
x = (1 - a / b) * (1 - c / d)
for i in range(10 ** 6):
	sum2 = sum2 * x
	sum1 = sum1 + sum2
print(sum1)


(a, b, c, d) = [int(s) for s in input().split(' ')]
pSmall = a / b
pInimigo = c / d
print(pSmall * (1 / (1 - (1 - pSmall) * (1 - pInimigo))))


a = list(map(int, input().split()))
print(a[0] * a[3] / (a[0] * a[3] + a[1] * a[2] - a[0] * a[2]))


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


line = input().split()
R = int(line[0]) / int(line[1])
Z = int(line[2]) / int(line[3])
prob = R * (1 / (1 - (1 - Z) * (1 - R)))
print(prob)


(a, b, c, d) = map(int, input().split())
p = a / b
q = c / d
wining_prob = p * (1 / (p + q - p * q))
print('{:0.12f}'.format(wining_prob))


(a, b, c, d) = map(float, input().split())
z = a * d / (a * d + c * (b - a))
print(f'{z:.6f}')


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


(a, b, c, d) = map(int, input().split())
eps = 1e-12
p = 0
pre = 1.0
while True:
	delta = 1.0 * pre * a / b
	if delta < eps:
		break
	pre = pre * (b - a) / b * (d - c) / d
	p += delta
print(p)


(a, b, c, d) = map(int, input().split())
if a / b == 1.0:
	print(1.0)
else:
	k1 = 1 - c / d
	k2 = 1 - a / b
	k3 = a / b / (1 - k1 * k2)
	print(k3)


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


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


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
(a, b, c, d) = rinput()
print(a / b / (1 - (1 - a / b) * (1 - c / d)))


(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)))))


eingabe = input()
y = [float(x) for x in eingabe.split(' ')]
p = y[0] / y[1]
q = y[2] / y[3]
r = -p / (p * q - p - q)
print(r)


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)


import sys
import math as mt
import bisect
t = 1
for __ in range(t):
	(a, b, c, d) = map(int, input().split())
	r = (1 - a / b) * (1 - c / d)
	ans = a / b / (1 - r)
	print(ans)


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


(a, b, c, d) = [int(k) for k in input().split()]
probAcertoA = a / b
probErroB = 1 - c / d
probErroA = 1 - a / b
probDoisErros = probErroB * probErroA
print(probAcertoA / (1 - probDoisErros))


(a, b, c, d) = map(int, input().split())
p1 = a / b
p2 = c / d
r = (1 - p2) * (1 - p1)
c = 0
ans = p1
for i in range(1, 10000):
	ans += p1 * r ** i
print(ans)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.setrecursionlimit(int(pow(10, 6)))
	sys.stdin = open('input.txt', 'r')
except:
	pass
(a, b, c, d) = L()
x = a / b
y = c / d
w = 1 - x
z = 1 - y
last = x
curr = x
prev = 0
while curr - prev > 10 ** (-9):
	prev = curr
	last = last * w * z
	curr += last
print(curr)
endtime = time.time()


(a, b, c, d) = [int(x) for x in input().split(' ')]
r = a / b
z = c / d
k = (1 - r) * (1 - z)
print(r / (1 - k))


t = input()
temp = t.split()
a = int(temp[0])
b = int(temp[1])
c = int(temp[2])
d = int(temp[3])
r = (1 - a / b) * (1 - c / d)
z = a / b
result = z * (1 / (1 - r))
print(result)


(a, b, c, d) = [int(i) for i in input().split()]
pS = a / b
pZ = c / d
print(pS / (pS + pZ - pS * pZ))


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))))


l = input().split()
p = int(l[0]) / int(l[1])
d = int(l[2]) / int(l[3])
print(p / (d + p - p * d))


inp = input().split()
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
d = int(inp[3])
Rwin = a / b
Rlose = 1 - Rwin
Zlose = 1 - c / d
print('%.7f' % (Rwin / (1 - Rlose * Zlose)))


abcd = [int(i) for i in input().split()]
print(abcd[0] / abcd[1] / (1 - (1 - abcd[0] / abcd[1]) * (1 - abcd[2] / abcd[3])))


(a, b, c, d) = map(int, input().split(' '))
t = 1 - a / b
tt = 1 - c / d
rr = a / b
rrr = 1 - t * tt
print(rr / rrr)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def inln():
	return sys.stdin.readlines()
(a, b, c, d) = invr()
p1 = a / b
p2 = c / d
global p_win
global new_p
p_win = p1
new_p = p1
for i in range(1, 10000):
	new_p = new_p * (1 - p1) * (1 - p2)
	p_win = p_win + new_p
print(round(p_win, ndigits=8))


(a, b, c, d) = [int(k) for k in input().split()]
q = (1 - a / b) * (1 - c / d)
print(a / b / (1 - q))


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


n = input()
(a, b, c, d) = n.split()
a = float(a)
b = float(b)
c = float(c)
d = float(d)
start = a / b
r = (1 - start) * (1 - c / d)
ans = start / (1 - r)
print(ans)


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


(a, b, c, d) = map(int, input().split())
r = 0
t = 1
while t > 10 ** (-10):
	r += t * a / b
	t *= (1 - a / b) * (1 - c / d)
print(r)


(a, b, c, d) = input().split()
temp1 = float(a) / float(b)
temp2 = float(c) / float(d)
temp3 = temp1 / (1 - (1 - temp1) * (1 - temp2))
print('%.12f' % temp3)


L = [int(x) for x in input().split()]
p1 = float(L[0]) / L[1]
p2 = float(L[2]) / L[3]
print(p1 / (p1 + p2 - p1 * p2))


import math
(a, b, c, d) = map(int, input().split())
s = a / b
z = c / d
psw = 0
c = 0
while True:
	temp = (1 - s) ** c * (1 - z) ** c * s
	psw += temp
	c += 1
	if temp < 10 ** (-11):
		break
print(round(psw, 7))


def main():
	(a, b, c, d) = map(int, input().split())
	print('{:.9f}'.format(a * d / (b * c + a * d - a * c)))
main()


(a, b, c, d) = [int(i) for i in input().split()]
probSmallR = a / b
probAux = (1 - a / b) * (1 - c / d)
result = probSmallR / (1 - probAux)
print(result)


args = list(map(float, input().split(' ')))
(a, b, c, d) = (args[0], args[1], args[2], args[3])
ab = a / b
cd = c / d
acbd = a * c / (b * d)
total = 0
for i in range(100000):
	total += ab * (1 - ab - cd + acbd) ** i
print(total)


def archer(a, b, c, d):
	loss1 = 1 - a / b
	loss2 = 1 - c / d
	win1 = a / b
	return win1 * (1 / (1 - loss1 * loss2))
(a, b, c, d) = map(int, input().strip().split())
print(archer(a, b, c, d))