### Problem Description：

There are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C know each other. But this may not imply that A and C know each other.

Now you are given all pairs of students who know each other. Your task is to divide the students into two groups so that any two students in the same group don't know each other.If this goal can be achieved, then arrange them into double rooms. Remember, only paris appearing in the previous given set can live in the same room, which means only known students can live in the same room.

Calculate the maximum number of pairs that can be arranged into these double rooms.

### Input：

For each data set:
The first line gives two integers, n and m(1<n<=200), indicating there are n students and m pairs of students who know each other. The next m lines give such pairs.

Proceed to the end of file.

### Output：

If these students cannot be divided into two groups, print "No". Otherwise, print the maximum number of pairs that can be arranged in those rooms.

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

No
3

### 题解：

1. 定义一个空集U，放入起始点。
2. 搜索相邻的点，判断该点是否是一条匹配线的一点，不是则把那一邻点加入集合U；是，则对此点DFS搜索一个相邻的点，直到该点不在一条匹配线上。由此得到一条线段，匹配线与非匹配相交替，非匹配比匹配线多1，反过来看（把匹配看成非匹配的、非匹配看成匹配的），则是匹配比非匹配多一条。
3. 循环步骤2，如果不能继续则结束。

### Code：

include"stdio.h"
include"string.h"
include"iostream"
include"queue"
using namespace std;
define N 205
int find(int a)       //匈牙利算法
{
int i;
for(i=1;i<=n;i++){
if(!mark[i]&&map[a][i]){
mark[i]=1;
return 1;
}
}
}
return 0;
}
int judge()        //判断是否是二分图
{
int i,cur;
queueq;       //队列声明
q.push(1);       //把1加入队列
while(!q.empty()){
cur=q.front();      //取队首元素
q.pop();             //删除队首元素
for(i=1;i<=n;i++){
if(map[cur][i]){      //1和2、3认识则把2、3均标记为2；
if(color[i]==-1){
color[i]=1-color[cur];
q.push(i);
}
else if(color[i]==color[cur])      //接下来到2出对时，color[3]=color
return 0;
}
}
}
return 1;
}
int main()
{
int i,j,m,ans;
while(scanf("%d%d",&n,&m)!=-1){
memset(map,0,sizeof(map));
memset(color,-1,sizeof(color));
while(m--){
scanf("%d%d",&i,&j);
map[i][j]=map[j][i]=1;
}
if(judge()==0){
printf("No\n");
continue;
}
ans=0;
for(i=1;i<=n;i++){
memset(mark,0,sizeof(mark));
ans+=find(i);
}
printf("%d\n",ans/2);
}
return 0;
}