Strongest Friendship Group

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Farmer John has NN cows (2N1052\le N\le 10^5), conveniently labeled 1N1 \ldots N. There are MM (1M21051\le M\le 2\cdot 10^5) pairs of friends among these cows.

A group of cows is called a "friendship group" if every cow in the group is reachable from every other cow in the group via a chain of friendships that lies solely within the group (friendships connecting to cows outside the group have no impact). The "strength" of a friendship group is the minimum number of friends of any cow in the group within the group times the number of cows in the group (again, note that friendships connecting to cows outside the group do not count for this definition).

Please find the maximum strength over all friendship groups.

입력

The first line contains NN and MM.

The next MM lines contain two integers u_iu\_i and v_iv\_i denoting that cows u_iu\_i and v_iv\_i are friends (1u_i,v_iN1\le u\_i,v\_i\le N, u_iv_iu\_i\neq v\_i). No unordered pair of cows appears more than once.

출력

One line containing the maximum strength over all friendship groups.

힌트

The maximum strength can be observed to be with the group of cows numbered 1,2,3,41, 2, 3, 4. The minimum number of friends of any cow in this group within the group is 33, so the answer is 43=124\cdot 3=12.