human
Write me a Python program to determine the probability of the trick being successful if this is the case given the following:
Alex enjoys performing magic tricks. He has a trick that requires a deck of n cards. He has m identical decks of n different cards each, which have been mixed together. When Alex wishes to perform the trick, he grabs n cards at random and performs the trick with those. The resulting deck looks like a normal deck, but may have duplicates of some cards.

The trick itself is performed as follows: first Alex allows you to choose a random card from the deck. You memorize the card and put it back in the deck. Then Alex shuffles the deck, and pulls out a card. If the card matches the one you memorized, the trick is successful.

You don't think Alex is a very good magician, and that he just pulls a card randomly from the deck. Determine the probability of the trick being successful if this is the case.

Input

First line of the input consists of two integers n and m (1 ≤ n, m ≤ 1000), separated by space — number of cards in each deck, and number of decks.

Output

On the only line of the output print one floating point number – probability of Alex successfully performing the trick. Relative or absolute error of your answer should not be higher than 10 - 6.

Examples

Input

2 2

Output

0.6666666666666666

Input

4 4

Output

0.4000000000000000

Input

1 2

Output

1.0000000000000000

Note

In the first sample, with probability  Alex will perform the trick with two cards with the same value from two different decks. In this case the trick is guaranteed to succeed.

With the remaining  probability he took two different cards, and the probability of pulling off the trick is .

The resulting probability is 
Using python can you solve the prior task?
assistant
#Here is Python program to determine the probability of the trick being successful if this is the case.

#!/usr/bin/python
import sys
from collections import defaultdict
from itertools import combinations, combinations_with_replacement
from fractions import Fraction as F
# from sympy import *

def Ni(): return tuple(map(int, sys.stdin.readline().split()))

def frequency(l):
    d = defaultdict(int)
    for item in l:
        d[item] += 1
    return d

def factorial(k):
    r = 1
    for k in range(2, k+1):
        r = r * k
    return r

def choose(n, k):
    return factorial(n) / factorial(n-k) / factorial(k)

def d(n, m):
    a = range(n) * m
    L = []
    for c in combinations(a, n):
        L.append(tuple(sorted(frequency(c).values())))

    ff = frequency(L)
    # sum of ff.values() == n*m choose n
    N = choose(n*m, n)
    # print ff
    r = []
    for c, cf in ff.items():
        #print c, cf
        r.append(sum(F(_c * _c, n * n) for _c in c) * F(cf, N))
    #print r
    return sum(r)

if False:
    r = d(2, 2)
    print r
    r = d(4, 4)
    print r
    r = d(1, 2)
    print r

def de(n, m):
    return F(1,n) + F(n - 1, n) * F(m - 1, m * n - 1) if m * n > 1 else F(1,n)

def fitrational(T):
    a = Symbol('a')
    b = Symbol('b')
    c = Symbol('c')
    d = Symbol('d')
    e = Symbol('e')
    f = Symbol('f')
    g = Symbol('g')
    h = Symbol('h')
    i = Symbol('i')
    j = Symbol('j')
    l = Symbol('l')

    def targetFunction(n, m):
        k = 1   # wlog; otherwise divide by k
        return (a * m + b * n + c * m * n + d) / \
               (e * m * m + f * n * n + g * m * n * n + h * m * m * n + i * m * n + j * m + k * n + l)
    
    answer = targetFunction(Symbol('n'), Symbol('m'))

    def makeEquation(n, m, v):
        return Eq(targetFunction(n, m), v)

    VARS = [a,b,c,d,e,f,g,h,i,j,l]
    EQS = []

    # avoid n == 1 or m == 1 cases
    for n in range(2, 6):
        for m in range(2, 6):
            if len(EQS) < len(VARS):
                EQS.append(makeEquation(n, m, T(n, m)))

    #for e in EQS:
    #    print e
    #print len(EQS), len(VARS)

    _s = solve(EQS, VARS)
    #print _s

...