Question: please write me a c language code and keep it simple here is the specifications:In this project, you will implement a system that determines the

please write me a c language code and keep it simple here is the specifications:In this project, you will implement a system that determines the winnerand therunner upof a football tournament. Generally, football matches are played inrounds. In the first round, every two teams play one match and only the winnerqualifies to the next round. The winners of a round are reduced by half using thisprocedure. This continues until the final round where exactly two teams play andthe winner is declared as the champion. The loser of this final match isconsidered the second. However, some argue that this isunfair and that thesecond winner of the game should be the best team of all the teams that lostagainst the champion of the tournament.In this project, you will write a program to determine thewinner and therealrunner-up in the tournament. There are n teams denotedby n distinct integerIDs. These n teams will play in a cup manner until the champion is determined.The winner in any match is the team with the smaller ID (if the round number isodd,) or the team with the larger ID (if the round number is even.) If, atanyround, the number of teams is odd, the last team in the list is qualifiedautomatically to the next round, but is placed in the head of the next list (in theexample below, team 2 qualifies automatically to round 2. Similarly, team 6 toround 3.)When the champion is determined, there will be another tournament (therunner-uptournament) for all the teams that lost against the champion. Theseteams will be placed in the list in reverse order so that the team that lost to thechampion in the final round is placed first, and so on. These teams will play againinanother tournamentwith the same rules usedbefore. The winner this time isthe realrunner-up.For example, the figure below shows a tournament offive teams (IDs: 4,3,6,9,and 2) compete, and team 3is the cup champion. Teams that lost to team 3(6,2,and 4) play in the secondary tournament to determine the team in the secondplace. The realrunner-upis team 4, not 6.In this program there will be no menu. Instead, your program will run onmultipleinput cases to test the validity and correctness of your code.Input format:Your program will be tested on multiple test cases. Each test case is written on asingle text line using the following format:n, id1, id2,..., idnwhere n is the number of teams, and idiis the identifier for the ithteam and1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!