There is a forest in front of the Wowo village, this forest can prevent the invasion of wind and sand. But there is a rule that thenumber of tallest trees in the forest should be more than half of all trees, so that it canprevent the invasion of wind and sand. Cutting down a tree need to cost a certain amount of money. Different kinds of trees cost different amounts of money. Wow village is also poor.There aren kinds of trees. The number of i-th kind of trees is. , the cost of cutting down one i-th kind of trees is
The Wow village is often hit by wind and sand,the sandstorm seriously hindered the economic development of the Wow village. There is a forest in front of the Wowo village, this forest can prevent the invasion of wind and sand. But there is a rule that the number of tallest trees in the forest should be more than half of all trees, so that it can prevent the invasion of wind and sand. Cutting down a tree need to cost a certain amount of money. Different kinds of trees cost different amounts of money. Wow village is also poor. There are n kinds of trees. The number of i-th kind of trees is P_i P i , the height of i-th kind of trees is H_i H i , the cost of cutting down one i-th kind of trees is C_i C i . (Note: "cutting down a tree" means removing the tree from the forest, you can not cut the tree into another height.)