#P8653. [蓝桥杯 2017 国 C] 分考场(假题:最小色数)

[蓝桥杯 2017 国 C] 分考场(假题:最小色数)

Problem Description

nn people are taking a special exam.

To ensure fairness, any two people who know each other cannot be assigned to the same exam room.

Find the minimum number of exam rooms needed to satisfy this condition.

Input Format

The first line contains an integer n(1<n<100)n(1<n<100), which is the number of people taking the exam.

The second line contains an integer mm, meaning that there are mm lines of data following.

Each of the next mm lines has the format: two integers aa, bb, separated by a space (1a,bn)(1 \le a,b \le n), indicating that person aa knows person bb (numbering starts from 11).

Output Format

Output one integer on a single line, representing the minimum number of exam rooms.

5
8
1 2
1 3
1 4
2 3
2 4
2 5
3 4
4 5
4
5
10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
5

Hint

Time limit: 1 second, 256M. Lanqiao Cup 2017, the 8th National Finals.

Translated by ChatGPT 5