Problem10627--洛谷P3554 - [POI2013] LUK-Triumphal arch

10627: 洛谷P3554 - [POI2013] LUK-Triumphal arch

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

给一颗 $n$ 个节点的树($n \le 3 \times 10^5$),初始时 $1$ 号节点被染黑,其余是白的。两个人轮流操作,一开始 B 在 $1$ 号节点。每一轮,A 选择 $k$ 个点染黑,然后 B 走到一个相邻节点,如果 B 当前处于白点则 B 胜,否则当 A 将所有点染为黑点时 A 胜。求能让 A 获胜的最小的 $k$ 。


【提示】

给一颗树,1号节点已经被染黑,其余是白的,两个人轮流操作,一开始B在1号节点,A选择k个点染黑,然后B走一步,如果B能走到A没染的节点则B胜,否则当A染完全部的点时,A胜。求能让A获胜的最小的k

Input

The first line of the standard input contains a single integer $n$, the number of towns in Byteotia. The towns are numbered from 1 to $n$, where the number 1 corresponds to the capital.
The road network is described in $n$ lines that then follow.
Each of those lines contains two integers, $u,v\ (1 \leq u,v\leq n)$, separated by a single space, indicating that towns $u$ and $v$ are directly connected with a two way road.

Output

The first and only line of the standard output is to hold a single integer,    the minimum number of crews that Byteasar's advisor needs to hire.

Sample 1 Input

7
1 2
1 3
2 5
2 6
7 2
4 1

Sample 1 Output

3

HINT

洛谷P3554.

Source/Category