Logo
(追記) (追記ここまで)

3737번 - Cycles of Lanes 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB119554147.674%

문제

Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by more than one lane and it is possible to pass from each crossroad to each other crossroad by a path composed of one or more lanes. A cycle of lanes is simple when passes through each of its crossroads exactly once.

The administration of the University would like to put on the lanes pictures of the winners of Regional Collegiate Programming Contest in such way that the pictures of winners from the same university to be on the lanes of a same simple cycle. That is why the administration would like to assign the longest simple cycles of lanes to most successful universities. The problem is to find the longest cycles? Fortunately, it happens that each lane of the park is participating in no more than one simple cycle (see the Figure).

입력

On the first line of the input file the number T of the test cases will be given. Each test case starts with a line with the positive integers N and M, separated by interval (4 ≤ N ≤ 4444). Each of the next M lines of the test case contains the labels of one of the pairs of crossroads connected by a lane.

출력

For each of the test cases, on a single line of the output, print the length of a maximal simple cycle.

제한

예제 입력 1

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

예제 출력 1

4

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2009 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /