Optimal ability loadout

No attempts yetTime limit1sMemory limit512 MB

Problem

Gyeonggeun plays a web game where he fights monsters, and he has collected NN attack abilities. To keep track of them he numbered the abilities 1 through NN.

Ability ii has a trigger probability pip_i and a damage value did_i. When Gyeonggeun issues a trigger command to ability ii, the ability triggers with probability pip_i and deals did_i damage to the opponent, and with probability 1pi1 - p_i nothing happens.

Gyeonggeun can now equip and unequip abilities freely. Whenever he gets one attack, the equipped abilities go through this process.

  • Pick one of the equipped abilities that has not received a trigger command yet, each with the same probability.
  • Issue a trigger command to the picked ability. If the ability triggers, the opponent takes that ability's damage and the attack ends.
  • If the ability does not trigger, repeat the same step with the abilities that are left. If every equipped ability has received a trigger command and none of them triggered, the attack ends without damage.

Given the trigger probability and the damage of the NN abilities, find the expected damage of one attack when the abilities are equipped so that this expected damage is as large as possible.

Input

The first line has an integer NN (1N201 \le N \le 20). The ii-th of the next NN lines has two integers pip_i and did_i (1pi,di1001 \le p_i, d_i \le 100), separated by a space. Ability ii triggers with probability pip_i percent, that is pi/100p_i / 100, and deals did_i damage to the opponent.

Output

Print on one line the maximum expected damage over all ways of equipping the abilities, rounded to six digits after the decimal point. Print all six digits even when the value is an integer.

Hint

Equipping more abilities is not always better. An ability that always triggers but deals little damage ends the attack the moment it is picked, which lowers the expected damage.