#P10098. 树根和孩子
树根和孩子
Background
给定一棵树,输出树的根root,孩子最多的结点max以及他的孩子
Format
Input
n(结点数<=100),m(边数<=200)。
以下m行;每行两个结点x和y, 表示y是x的孩子(x,y<=1000)。
Output
第一行:树根:root。
第二行:孩子最多的结点max。
第三行:max的孩子。
Samples
8 7
4 1
4 2
1 3
1 5
2 6
2 7
2 8
4
2
6 7 8
Limitation
1s, 1024KB for each test case.
Related
In following homework: