#P3196. [HNOI2008] 神奇的国度
[HNOI2008] 神奇的国度
Description
Country K is obsessed with triangles; even interpersonal relationships follow a triangle principle. They consider a triangle relationship—namely, , , and are mutually acquainted—to be simple and efficient. To reinforce triangle relationships, Country K forbids the existence of four-cycle relationships, five-cycle relationships, and so on.
An -cycle relationship means that among people , there exist exactly acquaintance pairs: , , , , and no other acquaintance pairs among them. For example, a four-cycle relationship means that among , the pairs , , , are mutually acquainted, while and are not acquainted.
During a national contest, to prevent cheating, it is required that any two people who are acquainted must not be placed on the same team. The king wants to know the minimum number of teams needed.
Input Format
The first line contains two integers and (, ), indicating there are people and acquaintance pairs. The next lines each contain one pair of friends.
Output Format
Output a single integer: the minimum number of teams.
4 5
1 2
1 4
2 4
2 3
3 4
3
Hint
One possible arrangement: (1, 3) (2) (4).
Translated by ChatGPT 5
京公网安备 11011102002149号