-->
当前位置:首页 > 题库

PROGRAMMING:Bargains in wechat

Luz5年前 (2021-05-10)题库465
At present, micro businesses are rampant in the circle of friends, and there are various direct sales and agents, which make people dizzying. However, in the process of commodity circulation, prices will be increased layer upon layer, and this rule will certainly not change. For the sake of simplicity, let's assume that starting from the manufacturer, the price will be increased by R% after each level of agent, while the intermediary agent of wechat business is not responsible for sales, and only the last seller is responsible for sales. If I tell you the circulation chain of wechat business, can you find the cheapest seller?
###Input format:
The first line first outputs three numbers n, P and R, which are the number of micro business participants, the ex factory price of goods and the proportion of price increase. We assume that the micro business participants are numbered from 0 to n-1, and No. 0 is the manufacturer. Next, line n gives the agency information of each agent in the following format:
K ID[1] ID[2] ... ID[K]
Where k is the number of subordinates of the agent, followed by the number of subordinates. We assume that the superior of all agents and sellers is the only one.
###Output format:
For each group of input, output the cheapest price that users can buy and the number of the cheapest sellers. The price is accurate to 4 decimal places.
###Input example:
Here is a set of inputs. For example:
```in
10 1.80 1.00
3 2 3 5
1 9
1 4
1 7
0
2 6 1
1 8
0
0
0
```
###Output example:
The corresponding output is given here. For example:
```out
1.8362 2
```







answer:If there is no answer, please comment