Lukket

UNITED NATION SEATING - open to bidding

The United Nations hosts many events in which they have to seat representatives of various countries. Sometimes, countries are not on good terms and it would be bad form to seat the representatives of these countries next to each other. For example currently Pakistan is not too happy with the United States and would prefer not to sit next them at the dinner table. You work for the United Meeting of Diplomats Service (UMDs) and need to write a program to help them seat the diplomats. You can assume the table at which they will be seated is round so that the first country will sit next to the last country. Each country will present you with a list of “undesirable” neighbors which they want to avoid and your program will output a list of countries which represents a seating chart for the event.

For example Pakistan wants to avoid India, and the United States. The United States wants to avoid China. India wants to avoid France. China wants to avoid the US. France wants to avoid India. One possible seating is : Pakistan, China, India, US, and France.

Input All input will be from the keyboard. The first line of input n will be an integer containing the number of test cases. The first line of a test case will contain an integer m indicating the number of countries to be represented. The next m ( m > 1 )lines will contain each countries list of undesirable neighbors. The list of neighbors to avoid begins with an integer k ( k > 0) followed by k + 1 country codes (each separated by a single space) . Each country code will be 3 letters. The first country code is the name of country submitting the list. The remaining k country codes represent the list of countries to be avoided.

Output For each case there will be 1 line of output containing a list of countries or the word impossible . The list of the countries start with the first country in the input list and then continue in order. If more than one list satisfies all the criteria print the one which comes first alphabetically.

Sample Input

2

5

2 PAK IND USA

1 USA CHI

1 IND FRA

1 CHI USA

1 FRA IND

5

2 PAK IND USA

1 USA CHI

2 IND CHI FRA

2 CHI USA IND

1 FRA IND

Sample Output PAK CHI IND USA FRA

impossible

Færdigheder: C++ Programmering

Se mere: usa programming, round events, programming nation, bad programming, want work india, united, programming india, need write program, fra, united nations seating chart, list states usa, bidding service, chart output, dinner service, united states countries, usa fra, seat chart, open table, need print country, open meeting, projects bidding open let, usa states codes, countries states code, chart print, bidding service work

Om arbejdsgiveren:
( 0 bedømmelser ) Nigeria

Projekt-ID: #5998989

11 freelancere byder i gennemsnit $26 for dette job

dobreiiita

Hi, I am C++ expert and can surely help you here with this project. I have a lot of experience in helping students with their assignments and tutoring. Please communicate to discuss further. Thank you. Regards Anshu

$30 USD på 1 dag
(121 bedømmelser)
6.0
asadrana91

hi mate this is Asad, i have a lot of experience in c++ programming,just pm me some details,would surely help you out ,cheers :)

$25 USD på 1 dag
(6 bedømmelser)
3.1
slscripters

Good day, I'm an experienced C++ software developer, I wanna help you with your project. Please let me know if you are interested of my sskills. Sincerely, slscripters

$25 USD på 1 dag
(1 bedømmelse)
3.1
uzair11235

i am an excellent C and C++ programmer i can make your program in less than 3 hours please contact me and i can send you the executable to show you the program

$30 USD in 0 dage
(0 bedømmelser)
0.0
Suraj7Vdya

A proposal has not yet been provided

$25 USD in 5 dage
(0 bedømmelser)
0.0
idleswell

Hello, I have 25 years experience programming in C++. I will create a well-documented C++ program to seat diplomats according to the criteria given. A milestone payment for the full budget of your project must be Mere

$81 USD in 3 dage
(0 bedømmelser)
1.8
sergeymelnikov83

Hello. I work a system programmer and write exactly an С. I think, youre task is interested for me.I'll be glad to try do it

$10 USD in 2 dage
(0 bedømmelser)
0.0
bhaveshTheITguy

Hello, I am really really really really good at C++, please give me one chance, I will make a perfect application, my logic skills are awesome, don't believe me, see my work and my work will speak for itself.

$20 USD på 1 dag
(0 bedømmelser)
0.0
KrisD87

Hi there, This is a classical backtracking program that I could happily solve for you. I see this as a console app in which you could specify an input file as a command line parameter and the result could be display Mere

$25 USD på 1 dag
(0 bedømmelser)
0.0
sanjeev22gupta

Hi, I am a C++ professional, and having 5 years of working experience. I have checked your problem statement. I have already created a project regarding your requirement which fulfills your expected result. I need s Mere

$10 USD på 1 dag
(0 bedømmelser)
0.0
maitreyanaik

Experienced in C++ programming using classes, structures with 3 years of experience. Task can easily be done with the help of a structure of countries and an array country structures depicting countries to not be se Mere

$20 USD in 3 dage
(0 bedømmelser)
0.0
Eveler

oh olympic-conundrum. I have big experience in it. of course I can to solve this problem fast and not costly if you want.

$15 USD på 1 dag
(0 bedømmelser)
0.0