#596
Unrated
Strongest Friendship Group
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

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 uiu_i and viv_i denoting that cows uiu_i and viv_i are friends (1ui,viN1\le u_i,v_i\le N, uiviu_i\neq v_i). No unordered pair of cows appears more than once.

출력

One line containing the maximum strength over all friendship groups.

예제 입력 1

8 10
1 2
1 3
1 4
2 3
2 4
3 4
1 5
2 6
3 7
4 8

예제 출력 1

12

점수

For 1T31\le T\le 3, test case TT satisfies N16N \le 16. For 4T94\le T\le 9, test case TT satisfies N1000N\le 1000. For 10T2010\le T\le 20, test case TT satisfies no additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.