410000: GYM103895 J Dragon Buffs
Description
The Dragon is a Tier 6 Animal, available in the base game and Pack 1. Every time a Tier 1 Animal is bought, the Dragon buffs all friends (excluding the Dragon), giving them +1/+1, +2/+2, or +3/+3 depending on the level of the Dragon.
The sequel to Super Auto Pets, SAP+, allows you to send teams into battle with unlimited size! Each pet that is part of a team contributes a set number of "stat points" to the "power level" of a team, which is the sum of the stat points of individual pets after buffs are applied. Stat points and buffs are highly dependent on the order in which a player adds pets to a team, and more skilled players are better at maximizing the power levels of their teams through optimal play.
A classic dragon contributes 14 of its stat points to a team's power level in addition to buffing every other pet on the team by ADDING 2 stat points when added. A super dragon contributes 14 of its stat points to a team's power level in addition to buffing every other pet on the team by MULTIPLYING their stat points by 2 when added. For example, if we were to add a classic dragon and then a super dragon, the power level of the team would be 42. However, if we were to add a super dragon and then a classic dragon, the power level of the team would be 30 instead.
Danny, a newbie to SAP+, has $$$A$$$ classic dragons and $$$B$$$ super dragons available to form a team, but decides to add the $$$A+B$$$ pets to his team one at a time in uniformly random order (any ordering is equally likely) as he does not have an understanding of optimal gameplay. Can you help Danny compute the expected value of the power level of his team?
InputThe first and online line of input contains two space-separated integers $$$A$$$ and $$$B$$$ ($$$1 \leq A, B \leq 30$$$), representing the number of classic dragons and the number of super dragons, respectively, Danny has available to add to his SAP+ team in some random order.
OutputOutput a single number representing the expected power level of Danny's team. Answers within $$$10^{-4}$$$ of the judge solution will be accepted.
ExamplesInput1 1Output
36.0000000000Input
1 2Output
77.3333333333Input
2 1Output
60.6666666667