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: united nations seating chart, usa programming, round events, programming nation, bad programming, want work india, united, programming india, need write program, fra, list states usa, bidding service, chart output, dinner service, united states countries, usa fra, seat chart, open table, need print country, open meeting, usa states codes, countries states code, chart print, bidding service work, india event

Om arbejdsgiveren:
( 0 bedømmelser ) United States

Projekt-ID: #5995859

10 freelancere byder i gennemsnit $19 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
guvi2105

Hi, I will provide fully documented code along with build/run instructions if needed. Looking forward to working with you!

$20 USD på 1 dag
(4 bedømmelser)
2.9
aitgallon

hi..............message me i can work on this project...........waiting for your reply......Thnx.....Best Regards..........

$25 USD på 1 dag
(11 bedømmelser)
2.8
bhaveshTheITguy

Hello, I CAN SO DO THIS PROJECT, please let me do this, I have done these kinds of projects so many times, you don't have to pay me if you don't like my work, you will love my work, I really need a chance especially wh Mere

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

Hello. My name is Sergey. I wark a system programmer. I think, you task is interested and I will not have difficulties with its implementation. Thank you)

$25 USD in 3 dage
(0 bedømmelser)
0.0
mvantuyl

I can have this project completed within 2 days of your acceptance of my bid. The code will be commented and I will answer any questions you have about it.

$25 USD in 2 dage
(0 bedømmelser)
0.0
monojeetdebnath

I understand that you will be needing the code for this as soon as possible, you can mail me if u want it soon so that i can write it down for you and send you, it wont take much time though. If u want it do let me kno Mere

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

hi buddy, is this a ACM exercise? Following is my solution: In combinatorial mathematics there is method to enum all possible sequence, so we can get each sequence and check if it satisfies the requirement. In f Mere

$10 USD in 3 dage
(0 bedømmelser)
0.0
kktheoch

I have done similar projects in my past. This is a problem that falls under the "Ménage problems" section. You can google for that. I can have this done in a couple of days. Thank you and good luck.

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

Hi there, I can provide you a solution in no time for the project and if needed additional details about the implementation. Please contact me about any additional information. Best wishes, Cristina

$20 USD på 1 dag
(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.

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