Minimum and maximum connected component
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
An undirected graph is given. Find the size of its smallest and largest connected components.
Input
The first line contains two positive integers and — the number of vertices and edges of the graph. Each of the following lines contains two integers and — the description of an undirected edge.
Output
Print on one line the size of the smallest and largest connected components of the graph.
Examples
Input #1
Answer #1
Submissions 148
Acceptance rate 43%