AT_icpc2013summer_day4_e Optimal alpha beta pruning

Description

[problemUrl]: https://atcoder.jp/contests/jag2013summer-day4/tasks/icpc2013summer_day4_e

Input Format

Input follows following format: > $n$ > $p_1 p_2 \dots p_n$ > $k_1 t_{11} t_{12} \dots t_{1k}$ > $\vdots$ > $\vdots$ > $k_n t_{n1} t_{n2} \dots t_{nk}$ The first line contains an integer $n$, which means the number of vertices in game tree T. The second line contains $n$ integers $p_i$, which means the evaluation value of vertex $i$. Then, next $n$ lines which contain the information of game tree T. $k_i$ is the number of child nodes of vertex $i$, and $t_{ij}$ is the indices of the child node of vertex $i$. Input follows following constraints: - $2 \le n \le 100$ - $-10,000 \le p_i \le 10,000$ - $0 \le k_i \le 5$ - $2 \le t_{ij} \le n$ - Index of root node is $1$. - Evaluation value except leaf node is always $0$. This does not mean the evaluation values of non-leaf nodes are 0. You have to calculate them if necessary. - Leaf node sometimes have evaluation value of $0$. - Game tree T is tree structure.

Output Format

Print the minimum evaluation number of times and the maximum evaluation number of times in leaf node. Please separated by whitespace between minimum and maximum. ```plaintext minimum maximum ```

Explanation/Hint

Source Name\: [Summer Camp 2013](http://acm-icpc.aitea.net/index.php?2013%2FPractice%2F%B2%C6%B9%E7%BD%C9).