CF763D Timofey and a flat tree

题目描述

### 题目大意 给你一棵$n$个节点的无根树, 现在要你定一个根节点, 满足其不同构的子树的数量最大。

输入格式

第一行一个正整数$n$。 以下$n-1$行, 每行两个正整数$a_i,b_i$, 描述一组树上的边。

输出格式

一行一个正整数, 表示选定的根节点。 如果有多解输出一个即可。

说明/提示

In the first example we can stand in the vertex $ 1 $ or in the vertex $ 3 $ so that every subtree is non-isomorphic. If we stand in the vertex $ 2 $ , then subtrees of vertices $ 1 $ and $ 3 $ are isomorphic. In the second example, if we stand in the vertex $ 1 $ , then only subtrees of vertices $ 4 $ and $ 5 $ are isomorphic. In the third example, if we stand in the vertex $ 1 $ , then subtrees of vertices $ 2 $ , $ 3 $ , $ 4 $ , $ 6 $ , $ 7 $ and $ 8 $ are isomorphic. If we stand in the vertex $ 2 $ , than only subtrees of vertices $ 3 $ , $ 4 $ , $ 6 $ , $ 7 $ and $ 8 $ are isomorphic. If we stand in the vertex $ 5 $ , then subtrees of vertices $ 2 $ , $ 3 $ , $ 4 $ , $ 6 $ , $ 7 $ and $ 8 $ are isomorphic, and subtrees of vertices $ 1 $ and $ 9 $ are isomorphic as well: `

1 9

/\ /\

7 8 4 2

`