sections between two houses will be shut, in case there are no instructors in the two of them. Any remaining sections will remain open. It ought to be feasible to go between any two houses utilizing the underground sections that are open. Educators ought not reside
Correct answer will be upvoted else Multiple Downvoted. Computer science.
All sections between two houses will be shut, in case there are no instructors in the two of them. Any remaining sections will remain open.
It ought to be feasible to go between any two houses utilizing the underground sections that are open.
Educators ought not reside in houses, straightforwardly associated by an entry.
Kindly assist the coordinators with picking the houses where educators will reside to fulfill the security necessities or establish that it is unimaginable.
Input
The originally input line contains a solitary integer t — the number of experiments (1≤t≤105).
Each experiment begins with two integers n and m (2≤n≤3⋅105, 0≤m≤3⋅105) — the number of houses and the number of sections.
Then, at that point, m lines follow, every one of them contains two integers u and v (1≤u,v≤n, u≠v), depicting a section between the houses u and v. It is ensured that there are no two sections associating similar pair of houses.
The amount of qualities n over all experiments doesn't surpass 3⋅105, and the amount of qualities m over all experiments doesn't surpass 3⋅105.
Output
For each experiment, in case it is absolutely impossible to pick the ideal arrangement of houses, output "NO". In any case, output "YES", then, at that point, the all out number of houses picked, and afterward the records of the picked houses in subjective request.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)