Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1: Flora and Fauna The kingdoms of Flora and Fauna are at war with each other. The battle has become so intense that no

image text in transcribed
Task 1: Flora and Fauna The kingdoms of Flora and Fauna are at war with each other. The battle has become so intense that no one knows which kingdom will emerge victorious. The inhabitants of the Neutral Land want to know the outcome of the war. However, they are too afraid to go to the battlefield. So, they came up with a plan. They gathered information from the reports of the kingdoms of Flora and Fauna. They found information about all the one-on-one battles between the soldiers of the two kingdoms. They know the names of the soldiers who fought in each battle but don't know which kingdom each soldier belongs to. The inhabitants of the Neutral Land want to determine the maximum possible number of soldiers from either kingdom. Input: The input starts with an integer T(10), denoting the number of test cases. Each case contains an integer n(1n105), representing the number of one-on-one battles. The next n lines will contain two different integers uv(1u,v20000), indicating a battle between soldiers u and v. No battle will be mentioned more than once. Output: For each case, print the case number and the maximum possible number of soldiers from either kingdom. Task 1: Flora and Fauna The kingdoms of Flora and Fauna are at war with each other. The battle has become so intense that no one knows which kingdom will emerge victorious. The inhabitants of the Neutral Land want to know the outcome of the war. However, they are too afraid to go to the battlefield. So, they came up with a plan. They gathered information from the reports of the kingdoms of Flora and Fauna. They found information about all the one-on-one battles between the soldiers of the two kingdoms. They know the names of the soldiers who fought in each battle but don't know which kingdom each soldier belongs to. The inhabitants of the Neutral Land want to determine the maximum possible number of soldiers from either kingdom. Input: The input starts with an integer T(10), denoting the number of test cases. Each case contains an integer n(1n105), representing the number of one-on-one battles. The next n lines will contain two different integers uv(1u,v20000), indicating a battle between soldiers u and v. No battle will be mentioned more than once. Output: For each case, print the case number and the maximum possible number of soldiers from either kingdom

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions