Independent Set (Max)
시간 제한1초메모리 제한2048 MB
트리에서 서로 인접하지 않은 노드들의 집합을 골라 (노드 수) 곱하기 (모두 연결하는 데 필요한 최소 간선 수)를 최대로 만든다.
문제
You are given a tree of nodes (numbered from to ). The edges are numbered from to ; edge connects node and .
A non-empty set of nodes is independent if none of the nodes in the set are adjacent to each other. The following illustration provides an example of sets which are independent, and sets which are not. The nodes colored in red are the members of the set.

The score of an independent set can be calculated as the product of:
- the number of nodes in the set, and
- the minimum number of edges such that all nodes in the set are still connected.
The following illustration provides an example for calculating the score of an independent set. There are nodes in the set. The minimum number of edges to connect all nodes in the set is , as shown by the edges colored in red. The score of this set is .

Note that the score of an independent set consisting of only node is .
Determine the maximum score over all non-empty independent sets within the tree.
입력
The first line consists of an integer ().
Each of the next lines consists two integers (). The input edges form a tree.
출력
Output a single integer representing the maximum score over all non-empty independent sets within the tree.