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 . If we add person number 3 to the team then hardness factor decreases to . 2 3 Input The input will contain several test cases, each of them as described below. Consecutive test cases are separated by a single blank line. The first line of the input 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 a; and b; (1 < a;, b; < n, a; † b;) on a line. The order of people in a pair is arbitrary and no pair is listed twice. Output For each test case, write to the output an integer number k (1 < k < n) – 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. The outputs of two consecutive cases will be separated by a blank line. Note, that in the last example any team has hardness factor of zero, and any non-empty list of people is a valid answer.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Any language is OK.

please help me  ,thanks

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 . If we add person number
3 to the team then hardness factor decreases to .
2
3
Input
The input will contain several test cases, each of them as described below. Consecutive test cases are
separated by a single blank line.
The first line of the input 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 a; and b; (1 < a;, b; < n, a; † b;) on a line. The order of people in a pair is
arbitrary and no pair is listed twice.
Output
For each test case, write to the output an integer number k (1 < k < n) – 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.
The outputs of two consecutive cases will be separated by a blank line.
Note, that in the last example any team has hardness factor of zero, and any non-empty list of people
is a valid answer.
Transcribed Image Text: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 . If we add person number 3 to the team then hardness factor decreases to . 2 3 Input The input will contain several test cases, each of them as described below. Consecutive test cases are separated by a single blank line. The first line of the input 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 a; and b; (1 < a;, b; < n, a; † b;) on a line. The order of people in a pair is arbitrary and no pair is listed twice. Output For each test case, write to the output an integer number k (1 < k < n) – 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. The outputs of two consecutive cases will be separated by a blank line. Note, that in the last example any team has hardness factor of zero, and any non-empty list of people is a valid answer.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education