Biconnected Components

5

1 votes
Easy-Medium
Problem

Given a graph having N vertices and M edges, count the number of biconnected components having odd number of vertices and even number of vertices.

Input:
First line consists of two space separated integers N and M.
M lines follow each containing two space separated integers X and Y denoting there is an edge between vertices X and Y.

Output:
Print two space separated integers where first integer denotes the number of biconnected components having odd number of vertices and second integer denotes number of biconnected components having even number of vertices.

Constraints:
1 ≤ N ≤ 10
1 ≤ MN×(N1)2
0 ≤ X,Y < N

Sample Input
4 4
0 1
1 2
2 3
3 1
Sample Output
1 1
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?