Problem K
Chewbacca
You are given a tree of out-degree
![\includegraphics[width=.25\textwidth ]{picture.pdf}](/problems/chewbacca/file/statement/en/img-0001.png)
You need to output answers to
Input
The first line of input contains the integers
Output
Output
Sample Input 1 | Sample Output 1 |
---|---|
7 2 3 1 2 2 1 4 7 |
1 1 4 |
Sample Input 2 | Sample Output 2 |
---|---|
9 3 3 8 9 5 7 8 4 |
2 2 3 |