<PREV Problem:
NEXT>
Solved by 67 users: ...
UserDateAttemptTimeCMSC
Chmeli_BSU16 mar 2011C100.0210 
binsearch20 may 2011C200.0210 
drackz13 dec 2011C500.0116 
sabbathist14 mar 2011C++400.0120 
sabbathist14 mar 2011C++300.01394 
NIGHTFIT13 may 2012C++200.61519 
zmy24 feb 2008C++100.04520 
Rizvanov19 jan 2009C++400.89524 
Rizvanov19 jan 2009C++1300.11548 
Rizvanov19 jan 2009C++1100.09554 
Rizvanov19 jan 2009C++1000.08572 
DAV11 aug 2009C++500.37577 
Jacob14 feb 2011C++101.26591 
tourist09 mar 2008Kylix2103.67606 
Languages
C++
50
Java
7
FPC
5
C
4
Kylix
2
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Hard life

Time limit = 4 second(s)

John is a Chief Executive Officer at a privately owned medium size company. The owner of the company has decided to make his son Scott a manager in the company. John fears that the owner will ultimately give CEO position to Scott if he does well on his new manager position, so he decided to make Scott's life as hard as possible by carefully selecting the team he is going to manage in the company. John knows which pairs of his people work poorly in the same team. John introduced a hardness factor of a team ≈ it is a number of pairs of people from this team who work poorly in the same team divided by the total number of people in the team. The larger is the hardness factor, the harder is this team to manage. John wants to find a group of people in the company that are harderst to manage and make it Scott's team. Please, help him.

In the example on the picture the hardest team consists of people 1, 2, 4, and 5. Among 4 of them 5 pairs work poorly in the same team, thus hardness factor is equal to 5/4. If we add person number 3 tothe team then hardness factor decreases to 6/5.

Input The first line of the input file contains two integer numbers n and m (1 ≤ n ≤ 100, 0 ≤ m ≤ 1000). Here n is a total number of people in the company (people are numbered from 1 to n), and m is the number of pairs of people who work poorly in the same team. Next m lines describe those pairs with two integer numbers ai and bi (1 ≤ ai, bin, ai ≠ bi) on a line. The order of people in a pair is arbitrary and no pair is listed twice.

Output Write to the output file an integer number k (1 ≤ kn) — the number of people in the hardest team, followed by k lines listing people from this team in ascending order. If there are multiple teams with the same hardness factor then write any one.

Input#1
5 6
1 5
5 4
4 2
2 5
1 2
3 1
Output#1
4
1
2
4
5
Input#2
4 0
Output#2
1
1

Author:
NEERC 2006

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 18.232.133.231