QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 64 MB Total points: 100

#12686. Offices

Statistics

Bytel is a mobile telephony potentate. Each employee has been issued a company phone, the memory of which holds the numbers of some of his co-workers (all of them have his number in their phones as well). Due to dynamic growth of their operations the board of directors intends to move company headquaters to new office buildings. It has been decided - in order to boost work efficiency - that every pair of employees working in different buildings should know (reciprocally) each others phone number i.e. the memory of their company phone ought to hold necessary phone numbers.

Simultaneously, the board have decided to rent as many office buildings as possible to ensure good working conditions. Help the board of Bytel to plan the number of office buildings and their size in accordance with the aforementioned requirements.

Write a programme which:

  • reads the description of employees' phone number lists from the standard input
  • calculates the maximal number of office buildings and their sizes, satisfying board's conditions
  • writes the outcome to the standard output.

Input

The first line of the standard input consists of two integers: $n$ and $m$ ($2 ≤ n ≤ 100\,000$, $1 ≤ m ≤ 2\,000\,000$), separated by single spaces, denoting the number of Bytel employees and the number of pairs of employees who have their numbers in company phones, respectively. The employees are numbered from $1$ to $n$.

Each of the following $m$ lines contains a single pair of integers $a_i$ and $b_i$ ($1 ≤ a_i < b_i ≤ n$ for $1 ≤ i ≤ m$), separated by a single space, denoting that employees ai and bi have their numbers (reciprocally) in company phones' memory. Each pair of integers denoting a pair of employees shall occur once at the most in the standard input.

Output

The first line of the standard output should contain a single integer: the maximal number of office buildings that Bytel should rent. The second should contain a non-decreasing sequence of positive integers, separated by singe spaces, denoting the sizes of the office buildings (i.e. the numbers of employees working there). Should there exist more than one correct answer - write out any one of them.

Example

Input

7 16
1 3
1 4
1 5
2 3
3 4
4 5
4 7
4 6
5 6
6 7
2 4
2 7
2 5
3 5
3 7
1 7

Output

3
1 2 4

An exemplary correct distribution of employees in the office buildings: employee number 4 in the first office, numbers 5 and 7 in the second office, numbers 1, 2, 3, 6 in the third office building.

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.