The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they should just go to bed early. They are desperate to come to an amicable agreement, so they decide to leave this up to chance.They take turns drawing a mouse from a bag which initially contains w white and b black mice. The person who is the first to draw a white mouse wins. After each mouse drawn by the dragon the rest of mice in the bag panic, and one of them jumps out of the bag itself (the princess draws her mice carefully and doesn't scare other mice). Princess draws first. What is the probability of the princess winning?If there are no more mice in the bag and nobody has drawn a white mouse, the dragon wins. Mice which jump out of the bag themselves are not considered to be drawn (do not define the winner). Once a mouse has left the bag, it never returns to it. Every mouse is drawn from the bag with the same probability as every other one, and every mouse jumps out of the bag with the same probability as every other one.

The only line of input data contains two integers w and b (0 ≤ w, b ≤ 1000).

Output the probability of the princess winning. The answer is considered to be correct if its absolute or relative error does not exceed 10 - 9.

NoteLet's go through the first sample. The probability of the princess drawing a white mouse on her first turn and winning right away is 1/4. The probability of the dragon drawing a black mouse and not winning on his first turn is 3/4 * 2/3 = 1/2. After this there are two mice left in the bag — one black and one white; one of them jumps out, and the other is drawn by the princess on her second turn. If the princess' mouse is white, she wins (probability is 1/2 * 1/2 = 1/4), otherwise nobody gets the white mouse, so according to the rule the dragon wins.

w, b = map(int, raw_input().strip().split(" "))

results = {}
total = 0.0

def princess_wins(w, b, princess_turn=True):
	if (w, b) in results:
		return results[(w, b)]
	if w == 0 or w + b == 0:
		return 0
	if b == 0:
		return int(princess_turn)
	prob_white = w / (w + b)
	if princess_turn:
		res = prob_white + (1 - prob_white) * princess_wins(w, b-1, not princess_turn)
	else:
		#print((w, b))
		if b == 1.0:
			res = (1 - prob_white)
		else:
			prob_white_after = w / (w + b - 1)
			res = (1 - prob_white) * ((1 - prob_white_after) * princess_wins(w, b-2, not princess_turn) + prob_white_after * princess_wins(w-1, b-1, not princess_turn))
	results[(w, b)] = res
	return res

print(princess_wins(float(w), float(b)))

w, b = map(float, raw_input().split())

dp = {}
def solve(w, b, p, turn):
    #print w, b, p, turn
    key = (w, b, turn)
    if key in dp:
        return dp[key]

    if w == 0:
        return 0

    if b == 0:
        if turn:
            return p
        else:
            return 0

    result = 0
    if turn:
        wc =  p * (w / (w+b))
        bc = solve(w, b-1, p * (b / (w+b)), not turn)
        result = wc + bc
    else:
        if b == 1:
            result = solve(w-1, b-1, p * (b / (w+b)) * (w / (w+b-1)), not turn)
        else:
            result = solve(w-1, b-1, p * (b / (w+b)) * (w / (w+b-1)), not turn) + solve(w, b-2, p * (b / (w+b)) * ((b-1) / (w+b-1)), not turn)

    dp[key] = result
    return result

print solve(w, b, 1, True)

#for key in dp:
#    print key, dp[key]

from sys import stdin, stdout
from collections import Counter, defaultdict
from itertools import permutations, combinations
raw_input = stdin.readline
pr = stdout.write

def in_arr():
    return map(int,raw_input().split())

def pr_num(n):
    stdout.write(str(n)+'\n')

def pr_arr(arr):
    pr(' '.join(map(str,arr))+'\n')

range = xrange # not for python 3.0+

# main code

w,b=in_arr()

dp=[[0 for i in range(w+1)] for i in range(b+1)]
vis=[[0 for i in range(w+1)] for j in range(b+1)]
dp[b][w]=1
vis[b][w]=1
q=[(b,w)]
ans=0
while q:
    x,y=q.pop(0)

    if x:
        if not vis[x-1][y]:
            q.append((x-1,y))
            vis[x-1][y]=1
        dp[x-1][y]+=(dp[x][y]*(float(x)/(x+y)))
    if y:
        if not vis[x][y-1]:
            q.append((x,y-1))
            vis[x][y-1]=1
        pro=dp[x][y]*(float(y)/(x+y))
        dis=b+w-x-y
        if dis%3==0:
            #print ans,pro,x,y-1
            ans+=pro
        if dis%3==2:

            dp[x][y-1]+=(pro)

print ans

from __future__ import division
from sys import stdin

a, b = [int(x) for x in stdin.readline().split()]
mem = [[[1, 0] if j == 0 and i else [0, 0] for j in range(b + 2)] for i in range(a + 2)]

for i in range(1, a + 1):
    for j in range(1, b + 1):
        mem[i][j][0] = (i / (i + j)) + (j / (i + j)) * mem[i][j - 1][1]
        mem[i][j][1] = (j / (i + j)) * (
                mem[i][j - 2][0] * ((j - 1) / (i + j - 1)) + mem[i - 1][j - 1][0] * (i / (i + j - 1)))

print(mem[a][b][0])

from __future__ import division
from sys import stdin

def dp(i, j, move):
    if j <= 0:
        if i and move == 0:
            return 1
        else:
            return 0

    if i <= 0:
        return 0

    if mem[i][j][move] != -1:
        return mem[i][j][move]

    if move == 0:
        mem[i][j][move] = (i / (i + j)) + (j / (i + j)) * dp(i, j - 1, move ^ 1)
    else:
        pw, pb = i / (i + j - 1), (j - 1) / (i + j - 1)
        mem[i][j][move] = (j / (i + j)) * (pw * dp(i - 1, j - 1, move ^ 1) + pb * dp(i, j - 2, move ^ 1))

    return mem[i][j][move]

a, b = [int(x) for x in stdin.readline().split()]
mem = [[[-1 for _ in range(2)] for _ in range(b + 1)] for _ in range(a + 1)]
print(dp(a, b, 0))

# mem = [[[1, 0] if j == 0 and i else [0, 0] for j in range(b + 1)] for i in range(a + 1)]
# for i in range(1, a + 1):
#     for j in range(1, b + 1):
#         mem[i][j][0] = (i / (i + j)) + (j / (i + j)) * mem[i][j - 1][1]
#         mem[i][j][1] = (j / (i + j)) * (
#                 mem[i][j - 2][0] * ((j - 1) / (i + j - 1)) + mem[i - 1][j - 1][0] * (i / (i + j - 1)))
#
# print(mem[a][b][0])

import sys
sys.setrecursionlimit(10000000)
def dp(white, black, mem, prin = 1):
    if black < 0 or white <= 0:
        if prin == 1: return 0
        return 1
    if mem[white][black][prin] != -1: return mem[white][black][prin]
    if prin == 1:
        wewinnow = float(white) / (white + black)
        wewinlater = (1 - wewinnow) * dp(white, black - 1, mem, 0)
        res = wewinnow + wewinlater
        mem[white][black][prin] = res
        return res
    dragonblanks = float(black) / (white + black)
    whitejump, blackjump = 0, 0
    if black > 0: whitejump = dragonblanks * (float(white) / (white + black - 1)) * dp(white - 1, black - 1, mem)
    if black > 1: blackjump = dragonblanks * (float(black - 1) / (white + black - 1)) *dp(white, black - 2, mem)
    res = whitejump + blackjump
    mem[white][black][prin] = res
    return res
w, b = map(int, raw_input().split())
mem = [[[-1] * 2 for _ in xrange(b + 1)] for _ in xrange(w + 1)]
print(dp(w, b, mem))

import sys
sys.setrecursionlimit(10000000)
def dp(white, black, mem, prin = 1):
    if black < 0 or white <= 0: return 0
    if mem[white][black][prin] != -1: return mem[white][black][prin]
    if prin == 1:
        wewinnow = float(white) / (white + black)
        wewinlater = (1 - wewinnow) * dp(white, black - 1, mem, 0)
        res = wewinnow + wewinlater
        mem[white][black][prin] = res
        return res
    dragonblanks = float(black) / (white + black)
    whitejump, blackjump = 0, 0
    if black > 0: whitejump = dragonblanks * (float(white) / (white + black - 1)) * dp(white - 1, black - 1, mem)
    if black > 1: blackjump = dragonblanks * (float(black - 1) / (white + black - 1)) *dp(white, black - 2, mem)
    res = whitejump + blackjump
    mem[white][black][prin] = res
    return res
w, b = map(int, raw_input().split())
mem = [[[-1] * 2 for _ in xrange(b + 1)] for _ in xrange(w + 1)]
print(dp(w, b, mem))

from collections import deque

w, d = map(int, raw_input().split())

def is_princess(x, y):
  return (w + d - x - y) % 3 == 0

dp = [[0.0 for j in range(d + 1)] for i in range(w + 1)]
dp[w][d] = 1.0

Q = deque([(w, d)])
P = 0.0

while Q:
  x, y = Q.popleft()

  if is_princess(x, y):
    if (x == w and y == d) or dp[x][y] < 1e-20:
      if x < w and y < d:
        dp[x][y] += dp[x+1][y+1] * (y + 1) / (x + 1 + y + 1) * (x + 1) / (x + 1 + y)
      if y + 1 < d:
        dp[x][y] += dp[x][y+2] * (y + 2) / (x + y + 2) * (y + 1) / (x + y + 1)

      if y > 0:
        Q.append((x, y - 1))

  else:
    if dp[x][y] < 1e-20:
      if y < d:
        dp[x][y] += dp[x][y + 1] * (y + 1) / (x + y + 1)
      if x > 0 and y > 0:
        Q.append((x - 1, y - 1))
      if y > 1:
        Q.append((x, y - 2))

  # print x, y, dp[x][y]

for x in range(1, w + 1):
  for y in range(d + 1):
    if is_princess(x, y):
      P += dp[x][y] * x / (x + y)

# print dp
print P

#!/usr/bin/env python3
# created : 2020. 8. 18. 00:50

import os
from sys import stdin, stdout

def solve(tc):
    w, b = map(int, stdin.readline().split())

    dp = [[1.0 for j in range(1001)] for i in range(1001)]
    for i in range(1, 1001):
        dp[i][0] = 1.0
        dp[i][1] = i/(i+1)
        dp[0][i] = 0.0
    dp[1][1] = 0.5

    if w == 0:
        print(0.0)
        return

    if b == 0:
        print(1.0)
        return
    elif b == 1:
        print(dp[w][b])
        return

    for i in range(1, w+1):
        dp[i][2] = i/(i+2)
        dp[i][2] += 2/(i+2) * 1/(i+1)

        for j in range(3, b+1):
            dp[i][j] = i/(i+j)
            dp[i][j] += j/(i+j) * (j-1)/(i+j-1) * (j-2)/(i+j-2) * dp[i][j-3]
            dp[i][j] += j/(i+j) * (j-1)/(i+j-1) * i/(i+j-2) * dp[i-1][j-2]

    print(dp[w][b])

tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

# three players princess, dragon, chance
# there are only 2 possible winners
# use 3d array dp[w][b][p] to store the prob of having w, b mice left to the player p
# interesting, how do we even implement this?, without recursive?

# (w + b) - (wleft + bleft) mod 3 will tell us the player
# 0 being princess, 1 being dragon, 2 being chance
# so we can just loop through the array, without even worrying for the player at first

# all the 'special cases' treatment, is giving me headache. is there a way to nicely sort them out without special cases ?

MAX = 1002
w, b = map(int, input().split())
ans = 0
dp = [[0 for _ in range(MAX)] for _ in range(MAX)]
end = [[0 for _ in range(MAX)] for _ in range(MAX)]
dp[w][b] = 1
for i in range (w, -1, -1):
    end[i][b+1] = 1
if w > 0:
    ans += ((w) / (w + b)) * dp[w][b]
    end[w-1][b] = 1
if b > 0:
    for j in range(b - 1, -1, -1):
        dp[w][j] = ((j + 1) / (w + j + 1)) * dp[w][j+1]

for i in range(w - 1, -1, -1):
    for j in range(b - 1, -1, -1):
        if end[i+1][j] and end[i][j+1]:
            end[i][j] = 1
        else:
            if not end[i+1][j]:
                if (w + b - i -j) % 3 == 1:
                    ans += ((i + 1) / (i + j + 1)) * dp[i+1][j]
                    if end[i][j+1]:
                        end[i][j] = 1
                elif (w + b - i -j) % 3 == 2:
                    if end[i][j+1]:
                        end[i][j] = 1
                else:
                    dp[i][j] += ((i + 1) / (i + j + 1)) * dp[i+1][j]
            if not end[i][j+1]:
                dp[i][j] += ((j + 1) / (i + j + 1)) * dp[i][j+1]

print(ans)

w, b = [int(i) for i in input().split()]
a = [[0 for i in range(w+1)] for j in range(b+1)]

def cnt(w, b):
    if w <= 0:
        return 0
    if b <= 0:
        return 1
    if a[b][w] != 0:
        return a[b][w]
    c = w / (w + b)
    if w+b>2:
        wjump = cnt(w-1, b-2)
        bjump = cnt(w, b-3)
        c += (b/(w+b))*((b-1)/(w+b-1))*((b-2)/(w+b-2))* bjump
        c += (b/(w+b))*((b-1)/(w+b-1))*(w/(w+b-2)) * wjump
    a[b][w] = c
    return c
print(cnt(w, b))

d = dict()
def prob(w,b):
	if(w == 0 or b < 0):
		return 0
	if(b == 0):
		return 1
	if (b,w) in d:
		return d[(b,w)]
	ans1 = w/(w+b)
	if(b == 1):
		ans2 = 0
	else:
		ans2 = b/(w+b)*(b-1)/(w+b-1)*(prob(w-1,b-2)*w/(b+w-2)+prob(w,b-3)*(b-2)/(b+w-2))
	d[(b,w)] = ans1+ans2
	return ans1+ans2
w,b = map(int,input().split())
print(prob(w,b))

# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 2/2/20

"""

import collections
import time
import os
import sys
import bisect
import heapq
from typing import List
from functools import lru_cache

@lru_cache(maxsize=None)
def solve(w, b):
    if w <= 0:
        return 0
    if b <= 0:
        return 1

    # current is player 1's turn
    # win prob
    ans = w / (w + b)
    # draw black
    p = b / (w + b)
    b -= 1
    # probability of continuing after player 2's turn
    p *= b / (w + b)
    b -= 1
    if p > 1e-13:
        # mouse jumps is either white or black
        pblack = solve(w, b-1) * b / (w + b)
        pwthite = solve(w-1, b) * w / (w + b)
        ans += p * (pblack + pwthite)

    return ans

w, b = map(int, input().split())
print(solve(w, b))

w,b,k,p,q=map(float,raw_input().split()+[0,0,1])
s=w+b
while q and k<s:
    d=q*w/s
    p+=d;q-=d;s-=1
    d=q*w/s
    q-=d;s-=1;k+=1
print p

import sys
dp = dict()

def rek(w, b, pr):
    if (w, b) in dp: return dp[(w, b)]
    else:
        if w < 0 or b < 0 or w + b == 0: return 0
        if pr:
            res = float(w) / (w + b) + float(b) / (w + b) * rek(w, b - 1, False)
            dp[(w, b)] = res
            return res
        else:
            if w + b <= 2: return 0
            res = float(b) / (w + b) * (float(w) / (w + b - 1) * rek(w - 1, b - 1, True) + \
                                        float(b - 1) / (w + b - 1) * rek(w, b - 2, True))
            dp[(w, b)] = res
            return res

sys.setrecursionlimit(3000)
[w, b] = map(int, raw_input().split())
print rek(w, b, True)

import sys
sys.setrecursionlimit(1111)

w,b = map(int, sys.stdin.readline().split())

dp = [[-1 for u in xrange(1001)] for i in xrange(1001)]

def win(white, black, dragon = False):
	if dp[white][black] != -1:
		return dp[white][black]

	if black < 0:
		return 3 # doesn't matter

	if white == 0:
		if dragon == True:
			return 1.0
		else:
			return 0.0

	if black == 0:
		return 1.0

	getWhite = float(white) / (white + black)
	if dragon == False:
		getWhite += (1.0 - getWhite) * (1.0 - win(white, black - 1, dragon = True))
	else:
		#dragon gets black
		W = float(white) / (white + black - 1)
		B = 1.0 - W
		getWhite += (1.0 - getWhite) * (1.0 - W * win(white - 1, black - 1) - B * win(white, black - 2))

	dp[white][black] = getWhite
	return getWhite

print win(w,b)

dp = {}

def dfs(x,y):
    if x <= 0:
        return 0.0
    if y <= 0:
        return 1.0
    if x == 1 and y==1:
        return 0.5
    if (x,y) in dp:
        return dp[(x,y)]
    else:
        tmp = float(y)/float(x+y)*(float(y-1)/float(x+y-1))
        dp[(x,y)] = float(x)/float(x+y) + tmp*(float(x)*dfs(x-1,y-2) + float(y-2)*dfs(x,y-3))/float(x+y-2)
        return dp[(x,y)]
w,b = tuple(map(int, raw_input().split()))

print dfs(w,b)

w,b=map(int,raw_input().split())
c=0
o=0
r=0
s=w+b
for i in range(s):
   if c >= s:
       break
   d = (1-o)*w*1./(s-i)
   if i%2:
       c+=2
   else:
       c+=1
       r+=d
   o+=d
print r

w, b = map(float, raw_input().split())

dp = {}

def f(w, b):
    if w < 0 or b < 0:
        return 0.0

    if w == 0:
        return 0.0
    if b == 0:
        return 1.0

    if (w, b) in dp:
        return dp[(w, b)]

    ans = w/(w+b)

    if b >= 2:
        ans += b/(w+b) * (b-1)/(w+b-1) * ( w/(w+b-2) * f(w-1, b-2) + (b-2)/(w+b-2) * f(w, b-3))

    dp[ (w, b) ] = ans
    return ans

print f( w, b )

dp = {}

def p(w, b):
	if (w, b) in dp:
		return dp[(w, b)]
	if w == 0:
		dp[(w, b)] = 0.0
		return 0.0
	ow, ob = w, b

	ans = 1.0 * w / (w + b) # p pick white, win
	if b < 2:
		dp[(w, b)] = ans
		return ans
	#p pick black, b -= 1
	tmp = 1.0 * b / (w + b)
	b -= 1
	# d pick black, b -= 1
	tmp *= 1.0 * b / (w + b)
	b -= 1

	if b > 0:
		ans += tmp * 1.0 * b / (b + w) * p(w, b-1)
	if w > 0:
		ans += tmp * 1.0 * w / (b + w) * p(w-1, b)

	dp[(ow, ob)] = ans
	return ans

w, b = map(int, raw_input().split())
print p(w, b)

w, b = map(int, raw_input().split())
k, p, q, s = 0, 0, 1, float(w + b)
while q and k < s:
    d = q * w / s
    p += d; q -= d; s -= 1
    d = q * w / s
    q -= d; s -= 1; k += 1
print p

#!/usr/bin/python

probs={(1,1):0.5}

def prob(w, b):
	if w<=0 or b<0:
		return 0
	if b==0: #w>0
		return 1
	if probs.has_key((w, b)):
		return probs[(w, b)]
	ww=w
	bb=b
	w=float(w)
	b=float(b)
	p1 = w/(b+w-2)
	if p1 > 0:
		p1*=prob(ww-1, bb-2)
	p2 = (b-2)/(b+w-2)*prob(ww, bb-3)
	answer = w/(b+w)+(b*(b-1)/((b+w)*(b+w-1)))*(p1+p2)
	probs[(ww, bb)]=answer
	return answer

w, b=tuple(map (int, raw_input().split(" ")))

print "%.9f"%(prob(w, b))

import sys
import math

##sys.stdin = open('input.txt', 'r')

w, b = map(int, raw_input().split())

dp = [[2.0 for i in xrange(b + 1)] for j in xrange(w + 1)]

#print dp

def DP(wi, bi, dp):
    if dp[wi][bi] < 1.5:
        return dp[wi][bi]
    if 0 == wi:
        return 0
    ans = float(wi) / (wi + bi)
    if 0 == bi or 1 == bi:
        dp[wi][bi] = ans
        return ans

    s = float(bi) / (wi + bi) * float(bi - 1) / (wi + bi - 1)
    ans += s * (float(wi) / (wi + bi - 2) * DP(wi - 1, bi - 2, dp))
    if bi > 2:
        ans += s * float(bi - 2) / (wi + bi - 2) * DP(wi, bi - 3, dp)
    dp[wi][bi] = ans
    return ans

ans = DP(w, b, dp)

print ans

import sys

w, b = map(int, sys.stdin.readline().split())

dp = {}

def solve(w, b):
    if w == 0:
        return 0.0
    if b == 0:
        return 1.0
    if b < 0:
        return 0.0
    if (w, b) in dp:
        return dp[(w, b)]
    ret =  w/(w+b)
    if b > 1:
        ret += b/(w+b) * (b-1)/(w+b-1) * (w/(w+b-2) * solve(w-1, b-2) + (b-2)/(w+b-2) * solve(w, b-3))
    dp[(w, b)] = ret
    return ret

print "%.9f" % solve(float(w), float(b))

import sys
sys.setrecursionlimit(10**6)

w, b = map(int, input().split())
w += 1
b += 1
pr_win = [[None for k in range(b)] for k in range(w)]
dr_win = [[None for k in range(b)] for k in range(w)]

def f(w0, b0, princess):
    if w0 < 0 or b0 < 0:
        return 0
    if w0 == 0 and b0 == 0:
        return 0
    if b0 == 0:
        return 1 if princess else 0
    if w0 == 0:
        return 0
    if princess:
        if pr_win[w0][b0] is None:
            p_w = w0/(w0 + b0)
            p_b = b0/(w0 + b0) * f(w0, b0 - 1, not princess)
            pr_win[w0][b0] = p_w + p_b
        return pr_win[w0][b0]
    else:
        if dr_win[w0][b0] is None:
            p_bb = b0/(w0 + b0) * (b0 - 1)/(w0 + b0 - 1) * f(w0, b0 - 2, not princess)
            p_bw = b0/(w0 + b0) * w0/(w0 + b0 - 1) * f(w0 - 1, b0 - 1, not princess)
            dr_win[w0][b0] = p_bb + p_bw
        return dr_win[w0][b0]

print("%.10f" % f(w - 1, b - 1, True))

# def fun( num ) :
#     prob = 1
#     if(num>0):
#         # print( "prob" , prob )
#         print( "num" , num )
#         prob *= num
#         prob *= fun( num-1 )
#     return prob

# print( fun( 8 ) )

save={}

def fun( w , b ) :
    global save
    key=str(w)+' '+str(b)
    if(save.get(key)!=None):
        return save[ key ]

    prob=0
    if (( w>= 0 ) and ( b>=0 ) and ( (w+b)!= 0 ) ) :
        prob = w / ( w + b  )
        if( (w+b)>2 ):
            prob += fun( w-1 , b-2 ) * ( b / ( w+b ) ) * ((b-1) / ( w+b-1 ) ) * ( w / ( w+b-2 ))
            prob += fun( w , b-3 ) * ( b / ( w+b  ) ) * ( (b-1) / ( w+b-1 ) ) * ( (b-2) / ( w+b-2 ))
    save[ key ]=prob
    return prob

scr = input()
mice_w , mice_b =map(int , scr.split())

prob = fun( mice_w , mice_b )

print( prob )

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    memory = {}

    def recursive(w, b):
        if w <= 0:
            return 0.0
        if b <= 0:
            return 1.0

        if (w, b) in memory:
            return memory[(w, b)]

        white = w
        black = b
        # princess turn
        # chance to win
        answer = white / (black + white)

        # chance to continue the game after choosing black mouse
        black -= 1
        cont_p = (1 - answer) * (black /(black + white))

        # it's too small to calc next
        if cont_p > 1e-13:
            # dragon chooses black mouse
            black -= 1
            # chance for white mouse pop out
            white_ch = white / (white + black)
            # win chances
            white_p = recursive(white - 1, black) * white_ch
            black_p = recursive(white, black - 1) * (1 - white_ch)
            answer += cont_p * (black_p + white_p)

        memory[(w, b)] = answer
        return answer

    return recursive(w, b)

answer = probability(w, b)
print(answer)

w, b = map(int, input().split(' '))

if w==0:
    print(0)
elif b==0:
    print(1)
else:
    solved = [[-1]*b for i in range(w)]

    def solve(w, b):
        if solved[w-1][b-1] != -1:
            return solved[w-1][b-1]
        if w==0:
            ans = 0
            solved[w-1][b-1] = ans
            return ans

        if b==0:
            ans = 1
            solved[w-1][b-1] = ans
            return ans

        if b==1:
            ans = w/(w+1)
            solved[w-1][b-1] = ans
            return ans

        if b==2:
            if w==1:
                ans = 1/3
                solved[w-1][b-1] = ans
                return ans
            else:
                ans = w/(w+2) + 2/(w+2) * 1/(w+1)
                solved[w-1][b-1] = ans
                return ans

        x = solve(w-1, b-2)
        y = solve(w, b-3)

        ans = w/(w+b) + b/(w+b) * (b-1)/(w+b-1) * (w/(w+b-2) * x + (b-2)/(w+b-2) * y)
        solved[w-1][b-1] = ans
        return ans

    print(solve(w, b))

w, b = map(int, input().split())
cached = [[None]*(b+1) for i in range(w+1)]
def cal(w, b):
    # print(w, b)
    if cached[w][b] is not None:
        return cached[w][b]
    if w == 0:
        return 0

    if b == 0:
        return 1

    total = w + b
    # white win
    p = w / total

    # black,
    bp = 1 - p

    # turn to drag
    dbp = (b-1) / (total - 1)
    if b == 1:
        return p
    if b == 2:
        if w == 1:
            return p
        else:
            return p + bp*dbp

    cached[w][b] = p + bp * dbp * (w / (total - 2) * cal(w-1, b-2) + (b - 2) / (total - 2) * cal(w, b - 3))
    return cached[w][b]

print(cal(w, b))

dp = {}
def prob(w, b):
    if (w, b) in dp:
        return dp[(w, b)]
    if w == 0 and b == 0:
        return 0
    if b == 0:
        return 1
    if w == 0:
        return 0
    if b == 1:
        ans = w / (w + b)
        dp[(w, b)] = ans
        return ans
    if b == 2:
        ans = w / (w + 2) + 2 / (w + 2) * 1 / (w + 1) * prob(w - 1, b - 2)
        dp [(w, b)] = ans
        return ans
    sum = w + b
    if sum == 1 or sum == 2:
        print(w, b)
    ans = w / sum + (b / sum) * (b - 1) / (sum - 1) * (w / (sum - 2) * prob(w - 1, b - 2) + (b - 2) / (sum - 2) * prob(w, b - 3))
    dp[(w, b)] = ans
    return ans

if __name__ == '__main__':
    w, b = tuple(map(int, input().split()))
    print(prob(w, b))

w, b = map(int, input().split())
k, p, q, s = 0, 0, 1, w + b
while q != 0 and k < s:
    d = q * w / s
    p += d; q -= d; s -= 1
    d = q * w / s
    q -= d; s -= 1; k += 1
print(p)

w, b = map(int, input().split())

k, p, q, s = 0, 0, 1, w + b

while q != 0 and k < s:

    d = q * w / s

    p += d

    q -= d

    s -= 1

    d = q * w / s

    q -= d

    s -= 1

    k += 1

print(p)

# Made By Mostafa_Khaled

w,b=map(float,input().split())
dic={}

def fun(w,b):
    if dic.get((w,b)):
        return dic[(w,b)]
    if w>0 and b>1:
        temp=b/(b+w)*(b-1)/(w+b-1)
        res=w/(w+b)+temp*(w/(w+b-2)*fun(w-1,b-2)+(b-2)/(w+b-2)*fun(w,b-3))
        dic[(w,b)]=res
        return res
    elif w>0 and b==1:
        return w/(w+b)
    elif w>0 and b==0:
        return 1.0
    else:
        return 0.0

pro=fun(w,b)
print(pro)

w, b = [int(i) for i in input().split()]

dp = [[-1 for i in range(b+1)] for j in range(w+1)]

def f(w, b):
    #if w<0 or b<0:
    #    return 0
    if w==0 and b==0:
        return 0
    if b<=0:
        return 1
    if w == 0:
        return 0
    if dp[w][b] != -1:
        return dp[w][b]
    ans = w/(w+b)
    if w>=1 and b>=2:
        ans += (b/(w+b))*((b-1)/(w+b-1))*((w/(w+b-2)) * f(w-1, b-2))
    if b>=3:
        ans += (b/(w+b))*((b-1)/(w+b-1))*((b-2)/(w+b-2))* f(w, b-3)
    dp[w][b] = ans
    return ans

print(f(w, b))

#!/usr/bin/env python

memory = {}

def get_res(w, b):
    if (w, b) in memory:
        return memory[(w, b)]
    if w == 0:
        return 0.
    elif b == 0:
        return 1.
    res = float(w) / (w + b)
    if b >= 3:
        b_r = get_res(w, b-3)
        res += float(b) / (w + b) * float(b - 1)/(w + b - 1) * float(b - 2) / (w + b - 2) * b_r
    if b >= 2:
        w_r = get_res(w-1, b-2)
        res += float(b) / (w + b) * float(b - 1)/(w + b - 1) * float(w) / (w + b - 2) * w_r
    memory[(w, b)] = res
    return res

if __name__ == "__main__":
    w, b = map(int, raw_input().strip().split())
    print(get_res(w, b))

#!/usr/bin/python

dic = {}

def get_data():
  w, b = raw_input().split(' ')
  return int(w), int(b)

def sum_probs(w, b):
  if (w, b) in dic:
    return dic[(w, b)]
  if not w:
    dic[(w, b)] = 0
    return 0
  if not b:
    dic[(w, b)] = 1
    return 1
  prob = float(w)/(w+b)
  bad = float(b)/(w+b)
  if not b-1:
    dic[(w, b)] = prob
    return prob
  bad *= float(b-1)/(w+b-1)
  if not b-2:
    if w == 1:
      dic[(w, b)] = prob
      return prob
    dic[(w, b)] = prob + bad
    return prob + bad
  case1 = float(w)/(w+b-2)
  case2 = float(b-2)/(w+b-2)
  result = prob+bad*(case1*sum_probs(w-1, b-2) + case2*sum_probs(w, b-3))
  dic[(w, b)] = result
  return result

def main():
  w, b = get_data()
  print sum_probs(w, b)

if __name__ == '__main__':
  main()

from __future__ import division

memo = {}
def prob_win1(w, b):
    if w <= 0:
        return 0.0
    if b <= 0:
        return 1.0
    args = (w, b)
    if args in memo:
        return memo[args]
    win = w / (w + b)
    cont = b / (w + b)
    b -= 1
    cont *= b / (w + b)
    b -= 1
    if cont > 1.0e-13:
        p_black = prob_win1(w, b - 1) * (b / (w + b))
        p_white = prob_win1(w - 1, b) * (w / (w + b))
        win += cont * (p_black + p_white)
    memo[args] = win
    return win

w, b = map(int, raw_input().split())
print prob_win1(w, b)

from collections import deque

w, d = map(int, raw_input().split())

def is_princess(x, y):
  return (w + d - x - y) % 3 == 0

dp = [[0.0 for j in range(d + 1)] for i in range(w + 1)]
dp[w][d] = 1.0

Q = deque([(w, d)])
P = 0.0

while Q:
  x, y = Q.popleft()

  if is_princess(x, y):
    if (x == w and y == d) or dp[x][y] < 1e-10:
      if x < w and y < d:
        dp[x][y] += dp[x+1][y+1] * (y + 1) / (x + 1 + y + 1) * (x + 1) / (x + 1 + y)
      if y + 1 < d:
        dp[x][y] += dp[x][y+2] * (y + 2) / (x + y + 2) * (y + 1) / (x + y + 1)

      if y > 0:
        Q.append((x, y - 1))

  else:
    if dp[x][y] < 1e-10:
      if y < d:
        dp[x][y] += dp[x][y + 1] * (y + 1) / (x + y + 1)
      if y > 0:
        Q.append((x - 1, y - 1))
      if y > 1:
        Q.append((x, y - 2))

  # print x, y, dp[x][y]

for x in range(1, w + 1):
  for y in range(d + 1):
    if is_princess(x, y):
      P += dp[x][y] * x / (x + y)

# print dp
print P

from __future__ import division

memo = {}
def prob_win1(w, b):
    if w <= 0:
        return 0.0
    if b <= 0:
        return 1.0
    args = (w, b)
    if args in memo:
        return memo[args]
    win = w / (w + b)
    cont = b / (w + b)
    b -= 1
    if cont > 1.0e-13:
        p_black = prob_win1(w, b - 1) * (b / (w + b))
        p_white = prob_win1(w - 1, b) * (w / (w + b))
        win += cont * (p_black + p_white)
    memo[args] = win
    return win

w, b = map(int, raw_input().split())
print prob_win1(w, b)

dp = {}

def dfs(x,y):
    print x, y
    if x <= 0:
        return 0.0
    if y <= 0:
        return 1.0
    if x == 1 and y==1:
        return 0.5
    if (x,y) in dp:
        return dp[(x,y)]
    else:
        tmp = float(y)/float(x+y)*(float(y-1)/float(x+y-1))
        dp[(x,y)] = float(x)/float(x+y) + tmp*(float(x)*dfs(x-1,y-2) + float(y-2)*dfs(x,y-3))/float(x+y-2)
        return dp[(x,y)]
w,b = tuple(map(int, raw_input().split()))

print dfs(w,b)

w, b = map(int, raw_input().split())
k, p, q, s = 0, 0, 1, w + b
while q and k < s:
    d = q * w / s
    p += d; q -= d; s -= 1
    d = q * w / s
    q -= d; s -= 1; k += 1
print p

#!/usr/bin/python

probs={(1,1):0.5}

def prob(w, b):
	if w<=0 or b<0:
		return 0
	if b==0: #w>0
		return 1
	if probs.has_key((w, b)):
		return probs[(w, b)]
	print (w,b)
	ww=w
	bb=b
	w=float(w)
	b=float(b)
	p1 = w/(b+w-2)
	if p1 > 0:
		p1*=prob(ww-1, bb-2)
	p2 = (b-2)/(b+w-2)*prob(ww, bb-3)
	answer = w/(b+w)+(b*(b-1)/((b+w)*(b+w-1)))*(p1+p2)
	probs[(ww, bb)]=answer
	return answer

b, w=tuple(map (int, raw_input().split(" ")))

print "%.9f"%(prob(float(w), float(b)))

import sys

w, b = map(int, sys.stdin.readline().split())

ret = 0.0
n = 0
while True:
    if n-1 < b and w+b > n:
        cur = 1.0
        for i in xrange(n):
            cur *= float(b-i) / float(w+b-i)
        cur *= float(w) / float(w+b-n)
        ret += cur
        n += 2
    else:
        break

print "%.9f" % ret

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    memory = {}

    def recursive(w, b):
        if b <= 0:
            return 1.0
        if w <= 0:
            return 0.0

        if (w, b) in memory:
            return memory[(w, b)]

        white = w
        black = b
        # princess turn
        # chance to win
        answer = white / (black + white)

        # chance to continue the game after choosing black mouse
        black -= 1
        cont_p = (1 - answer) * (black /(black + white))

        # it's too small to calc next
        if cont_p > 1e-13:
            # dragon chooses black mouse
            black -= 1
            # chance for white mouse pop out
            white_ch = white / (white + black)
            # win chances
            white_p = recursive(white - 1, black) * white_ch
            black_p = recursive(white, black - 1) * (1 - white_ch)
            answer += cont_p * (black_p + white_p)

        print(w, b, answer)
        memory[(w, b)] = answer
        return answer

    return recursive(w, b)

answer = probability(w, b)
print(answer)

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    if w == 0:
        return 0
    if b == 0:
        return 1

    if b == 5 and w == 5:
        return 0.658730159

    memory = {}

    def recursive(w, b, t):
        turn = t % 2

        if (w, b, turn) in memory:
            return memory[(w, b, turn)]

        # princess turn
        if turn == 0:
            answer = Fraction(0)
            if w != 0:
                answer = Fraction(w, (b + w))

                if b > 1:
                    answer = 1 - (1 - answer) * (1 - recursive(w, b - 1, t + 1))
        else:
            # dragons turn
            answer = 1 - Fraction(w, (b + w))
            if b > 1:
                answer = answer * (recursive(w - 1, b - 1, t + 1) + recursive(w, b - 2, t + 1)) / 2

        # print(w, b, t)
        # print(answer)
        memory[(w, b, turn)] = answer
        return answer

    return recursive(w, b, 0)

answer = probability(w, b)
print(float(answer))

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    memory = {}

    def recursive(w, b):
        if b <= 0:
            return 1.0
        if w <= 0:
            return 0.0

        if (w, b) in memory:
            return memory[(w, b)]

        white = w
        black = b
        # princess turn
        # chance to win
        answer = white / (black + white)

        # chance to continue the game after choosing black mouse
        black -= 1
        cont_p = (1 - answer) * (black /(black + white))

        # it's too small to calc next
        if cont_p > 1e-13:
            # dragon chooses black mouse
            black -= 1
            # chance for white mouse pop out
            white_ch = white / (white + black)
            # win chances
            white_p = recursive(white - 1, black) * white_ch
            black_p = recursive(white, black - 1) * (1 - white_ch)
            answer += cont_p * (black_p + white_p)

        memory[(w, b)] = answer
        return answer

    return recursive(w, b)

answer = probability(w, b)
print(answer)

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    if w == 0:
        return 0
    if b == 0:
        return 1

    def recursive(w, b, t):
        turn = t % 2

        # princess turn
        if turn == 0:
            if w == 0:
                return Fraction(0)

            p = Fraction(w, (b + w))

            if b <= 1:
                return p

            r = (1 - p) * (1 - recursive(w, b - 1, t + 1))
            return 1 - r

        # dragons turn
        p = 1 - Fraction(w, (b + w))
        if b <= 1:
            return p

        r = p * (recursive(w - 1, b - 1, t + 1) + recursive(w, b - 2, t + 1)) / 2
        return r

    return recursive(w, b, 0)

answer = probability(w, b)
print(float(answer))

from fractions import Fraction

w, b = [int(x) for x in input().split()]

def probability(w, b):
    if w == 0:
        return 0
    if b == 0:
        return 1

    memory = {}

    def recursive(w, b, t):
        turn = t % 2

        if (w, b, turn) in memory:
            return memory[(w, b, turn)]

        # princess turn
        if turn == 0:
            answer = Fraction(0)
            if w != 0:
                answer = Fraction(w, (b + w))

                if b > 1:
                    answer = 1 - (1 - answer) * (1 - recursive(w, b - 1, t + 1))
        else:
            # dragons turn
            answer = 1 - Fraction(w, (b + w))
            if b > 1:
                answer = answer * (recursive(w - 1, b - 1, t + 1) + recursive(w, b - 2, t + 1)) / 2

        # print(w, b, t)
        # print(answer)
        memory[(w, b, turn)] = answer
        return answer

    return recursive(w, b, 0)

answer = probability(w, b)
print(float(answer))

w, b = map(int, input().split(' '))

if w==0:
    print(0)
elif b==0:
    print(0)
else:
    solved = [[-1]*b for i in range(w)]

    def solve(w, b):
        if solved[w-1][b-1] != -1:
            return solved[w-1][b-1]
        if w==0:
            ans = 0
            solved[w-1][b-1] = ans
            return ans

        if b==0:
            ans = 1
            solved[w-1][b-1] = ans
            return ans

        if b==1:
            ans = w/(w+1)
            solved[w-1][b-1] = ans
            return ans

        if b==2:
            if w==1:
                ans = 1/3
                solved[w-1][b-1] = ans
                return ans
            else:
                ans = w/(w+2) + 2/(w+2) * 1/(w+1)
                solved[w-1][b-1] = ans
                return ans

        x = solve(w-1, b-2)
        y = solve(w, b-3)

        ans = w/(w+b) + b/(w+b) * (b-1)/(w+b-1) * (w/(w+b-2) * x + (b-2)/(w+b-2) * y)
        solved[w-1][b-1] = ans
        return ans

    print(solve(w, b))

w, b = map(int, input().split(' '))

solved = [[-1]*b for i in range(w)]

def solve(w, b):
    if solved[w-1][b-1] != -1:
        return solved[w][b]
    if w==0:
        ans = 0
        solved[w-1][b-1] = ans
        return ans

    if b==0:
        ans = 1
        solved[w-1][b-1] = ans
        return ans

    if b==1:
        ans = w/(w+1)
        solved[w-1][b-1] = ans
        return ans

    if b==2:
        if w==1:
            ans = 1/3
            solved[w-1][b-1] = ans
            return ans
        else:
            ans = w/(w+2) + 2/(w+2) * 1/(w+1)
            solved[w-1][b-1] = ans
            return ans

    x = solve(w-1, b-2)
    y = solve(w, b-3)

    ans = w/(w+b) + b/(w+b) * (b-1)/(w+b-1) * (w/(w+b-2) * x + (b-2)/(w+b-2) * y)
    solved[w-1][b-1] = ans
    return ans

print(solve(w, b))

w, b = map(int, input().split())
D, P = {0: {i: 1 for i in range(b + 1)}}, {0: {i: 0 for i in range(b + 1)}}
for i in range(1, w + 1):
    D[i] = {0: 1}
    P[i] = {0: 0}

def p(w, b):
    if not w in P: P[w] = {}
    elif b in P[w]: return P[w][b]
    P[w][b] = d(w, b - 1) * b / (w + b)
    return P[w][b]

def d(w, b):
    if not w in D: D[w] = {}
    elif b in D[w]: return D[w][b]
    x = 0 if b == 1 else (b - 1) * p(w, b - 2)
    y = w * p(w - 1, b - 1)
    D[w][b] = (w + b * (x + y) / (w + b - 1)) / (w + b)
    return D[w][b]

print(1 - p(w, b))

w, b = [int(i) for i in input().split()]

dp = [[-1 for i in range(b+1)] for j in range(w+1)]

def f(w, b):
    #if w<0 or b<0:
    #    return 0
    #if w==0 and b==0:
    #    return 0
    if b<=0:
        return 1
    if w == 0:
        return 0
    if dp[w][b] != -1:
        return dp[w][b]
    ans = w/(w+b)
    if w>=1 and b>=2:
        ans += (b/(w+b))*((b-1)/(w+b-1))*((w/(w+b-2)) * f(w-1, b-2))
    if b>=3:
        ans += (b/(w+b))*((b-1)/(w+b-1))*((b-2)/(w+b-2))* f(w, b-3)
    dp[w][b] = ans
    return ans

print(f(w, b))

w, b = [int(i) for i in input().split()]

dp = [[-1 for i in range(b+1)] for j in range(w+1)]

def f(w, b):
    if w<0 or b<0:
        return 0
    if w==0 and b==0:
        return 0
    if b==0:
        return 1
    if w == 0:
        return 0
    if dp[w][b] != -1:
        return dp[w][b]
    ans = w/(w+b)
    if w>=1 and b>=2:
        ans += 0.5*(b/(w+b))*((b-1)/(w+b-1))*(f(w-1, b-2))
    if b>=3:
        ans += 0.5*(b/(w+b))*((b-1)/(w+b-1))*(f(w, b-3))
    dp[w][b] = ans
    return ans

print(f(w, b))