Kill All Termites
시간 제한1초메모리 제한256 MB
나무를 어느 정점에서 뿌리내리고, 같은 간선을 연속으로 되짚지 않고 걷는 흰개미가 언제나 독점에 닿도록 독을 바를 최소 정점 수를 구한다.
문제
A tree is an undirected connected graph with vertices and edges.
You are given a tree. There are termites in some vertices of this tree. Your task is to kill them all. To do so, you can poison some of the vertices. If a termite visits a poisoned vertex, it immediately dies. Every second, each termite moves to an adjacent vertex. A termite cannot move along the same edge twice in a row, except when it gets into a leaf. Find the minimal possible number of vertices you can poison so that all the termites will eventually die, regardless of their initial positions and strategies.
입력
The first line contains one integer , the size of the tree ().
The second line contains integers , meaning that there is an edge between vertices and for ().
출력
Print one integer: the answer.