Meaning
This is a tower defense game, the map is a n numbered 1~n node of the tree, node 1 is the enemy base, the other leaf nodes are your base.
The enemy base will continue to come out of the monster, in order to prevent the enemy from attacking your base, you can choose to build towers.
Each node can only build one tower, and the node I may have the Ki species tower for you to choose from, the price and attack the Price_i, respectively, Power_i
Attack Power_i, the effect is to let the enemy pass through this node when the enemy's blood reduced power_i point.
Then from the base of the enemy to the path of any one of your bases, the damage of all towers on this path is the resistance of this base.
The enemy's attack path is uncertain, and in order to protect all of your bases, you need to determine the lowest resistance in all bases.
You only have a quantity of M of money, ask the best plan, can resist the enemy's maximum blood volume is how much? That is, make the lowest resistance in all bases as large as possible,
How much is the biggest?
Ideas:
Method One: Multi fork turn two fork
Turn the fork tree into the expression of "left son, right brother" first. It will be found that a structure diagram is formed:
Multi-fork Tree:
Into the two-forked tree of "left son, right brother":