#1116. 树的直径

树的直径

No submission language available for this problem.

Background

Special for beginners, ^_^

Description

给出一个 nn 个节点的树,求树的直径。

Note:树的直径定义为树中最远的两个节点之间的距离。

Format

Input

输入第一行为一个整数 nn,表示树的节点个数。 接下来 n1n-1 行,每行输入两个整数 xyx、y,表示 xxyy 之间有边相连。

Output

输出 11 个数,表示树的直径。

Samples

5
1 2
1 3
4 2
2 5
3

Limitation

2n20002≤n≤2000

1x,yn1≤x,y≤n

1s, 1024KiB for each test case.