bombing2

Problem Description

A town consists of N road intersections and E roads, with road i connecting towns Ai to Bi. It is guaranteed that no two roads connect the same two towns. At first, the entire town is connected, meaning it is possible to travel from any road intersection to any other through a series of roads. You are evil, and you want to bomb a particular road intersection, making it impassable. This will split the town up into several connected components, where it is only possible to travel between road intersections within each component. Given the map of the town, find out the maximum number of connected components you can split the town into.

Input

The first line of input will contain two integers, N and E.

The next E lines of input will contain two integers each, Ai and Bi.

Output

The output should contain one line with one integer, the maximum number of connected components that can be formed.

Limits

For all subtasks: 0 ≤ Ai, Bi < N.

Subtask 1 (21%): 2 ≤ N, E ≤ 1000.

Subtask 2 (15%): 2 ≤ N ≤ 200000, E = N - 1.

Subtask 3 (19%): 2 ≤ N ≤ 200000, E = N.

Subtask 4 (17%): 2 ≤ N, E ≤ 200000, you only have to determine if the maximum number is 1 or not 1. If the answer is not 1, any response from your program which is not 1 will be judged as correct.

Subtask 5 (28%): 2 ≤ N, E ≤ 200000.

Subtask 6 (0%): Sample Testcases.

Sample Input 1

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

Sample Output 1

3

Sample Input 2

5 4
0 1
0 2
0 3
0 4

Sample Output 2

4

Sample Input 3

4 6
0 1
0 2
0 3
1 2
1 3
2 3

Sample Output 3

1


Submitting .cpp to 'bombing2'


You're not logged in! Click here to login

Time Limit: 1 Seconds
Memory Limit: 256MB
Your best score: 0
Source: Dunjudge Archive

Subtask Score
1 21
2 15
3 19
4 17
5 28
6 0