#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
if __name__=='__main__':
argvs = sys.argv
if len(argvs) < 3 or not argvs[1].isdigit() or not argvs[2].isdigit():
print("Usage: {0} num1 num2".format(argvs[0]))
sys.exit()
if int(argvs[1]) == int(argvs[2]):
print("num1 = {0}, num2 = {1}, p = {2:.16f}".format(argvs[1], argvs[2], 1.0))
sys.exit()
arg = sorted(map(int, argvs[1:3]))
(sum_comb, comb, binary) = (1.0, 1.0, 0)
for i in range(0, arg[0]):
comb = comb * (arg[0] + arg[1] - i) / (i + 1)
sum_comb += comb
while (sum_comb > 1024):
sum_comb /= 1024; comb /= 1024; binary += 10
p = 2 * sum_comb / 2 ** (arg[0] + arg[1] - binary)
print("num1 = {0}, num2 = {1}, p = {2:.16f}".format(argvs[1], argvs[2], p))