Tree Diameter
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
A tree consisting of vertices is given.
The diameter of a tree is the maximum distance between two vertices. Find the diameter of the given tree.
Input
The first line contains an integer — the number of vertices in the tree. The vertices are numbered from to .
Each of the following lines describes an edge and contains two integers and , indicating that there is an edge between vertices and .
Output
Print one integer — the diameter of the tree.
Examples
Input #1
Answer #1
Submissions 237
Acceptance rate 42%