시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 71 28 15 28.846%

문제

In the country of Via, the cities are connected by roads that can be used in both directions. However, this has been the cause of many accidents since the lanes are not separated: The drivers frequently look at their smartphones while driving, causing them to collide with the oncoming traffic. To alleviate the problem, the politicians of Via came up with the magnificent idea to have one-way roads only, i.e., the existing roads are altered such that each can be only used in one of two possible directions. They call this “one-way-ification”.

The mayors do not want too many one-way roads to lead to their cities because this can cause traffic jam within the city: they demand that the smallest integer d be found such that there is a ‘one-way-ification’ in which for every city, the number of one-way roads leading to it is at most d.

입력

The input consists of:

  • one line with an integer n (1 ≤ n ≤ 500), where n is the number of cities labeled from 1 to n;
  • one line with an integer m (0 ≤ m ≤ 2.5 · 103), where m is the number of (bi-directional) roads;
  • m lines describing the roads. Each road is described by:
    • one line with two integers a and b (1 ≤ a, b ≤ n, a ≠ b) indicating a road between cities a and b.

There is at most one road between two cities.

출력

Output the minimum number d.

예제 입력

2
1
1 2

예제 출력

1

예제 입력 2

4
5
1 2
1 3
2 3
2 4
3 4

예제 출력 2

2

힌트