Lukket

Write some Software

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: Algoritme, C++ Programmering

Se mere: usa programming, us algorithm, test algorithm, round events, programming algorithm example, program algorithm example, line algorithm, good algorithm, example algorithm programming, example algorithm, chi software, bad programming, algorithm test, algorithm sample code, algorithm input, algorithm example, test case software, programming india, need write code, need write program, fra, write name software, united nations seating chart, list states usa, meeting software

Om arbejdsgiveren:
( 0 bedømmelser ) United States

Projekt-ID: #5988806

19 freelancere byder i gennemsnit $32 for dette job

dobreiiita

Hi, I am C++ and Algorithm 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. I will start Mere

$30 USD på 1 dag
(137 bedømmelser)
6.2
szymszteinsl

Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready ! Ready !

$50 USD in 3 dage
(20 bedømmelser)
6.0
KingOfPhoenix

Hi, Friend. I have enough experience in C programming. I also like to implement algorithm. I think I can help you perfectly & asap. Thanks.

$100 USD på 1 dag
(26 bedømmelser)
5.7
super2lao

A proposal has not yet been provided

$30 USD på 1 dag
(10 bedømmelser)
4.5
vietcompro

Hi there, I'm really interested in doing this project. Would you please initiate a chat for further discussion? If the number of countries is small (around 10), I believe this problem can be solved by using brute fo Mere

$40 USD på 1 dag
(25 bedømmelser)
4.4
phuocdh

I am an experienced programmer with over 3 years experience in Java, C#, 5 years in C, C++. I am good at math, algorithm and always provide clean code, well documented.

$30 USD på 1 dag
(10 bedømmelser)
3.2
shizong

I have read your requirement. I have 3 years programming experiences. I already have skills like your project. If you choose me, I will not let you down. I will wait for your reply

$30 USD på 1 dag
(9 bedømmelser)
3.1
guvi2105

Hi, I will provide documented code along with build/run instructions. I plan to this in C++ under Linux ? gcc compiler. Any objections? I'm looking forward to working with you!

$20 USD på 1 dag
(3 bedømmelser)
2.9
s3rg1u

hy i can help you with this , and i can provide you a solution in less than 24 hours if you award project to me. please contact if you are interested in my offer thanks

$30 USD på 1 dag
(5 bedømmelser)
2.9
sachitjani81

can do it...................................................................................................................

$18 USD på 1 dag
(1 bedømmelse)
2.2
faheem08003

A proposal has not yet been provided

$111 USD in 7 dage
(0 bedømmelser)
0.0
mingzixian523

Hello, sir. I have experience in c++ programming. and I also understand your require perfectly. Thanks. Regards.

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

Hi there,,, I'm greatly interested in this high valued project that you have posted as a big challenge for every [url removed, login to view] that I can meet your expectations and job requirements within timely deadline, although Mere

$45 USD in 5 dage
(0 bedømmelser)
0.0
swifthorse

Hello, sir. I am very interested in your job. I already made demo for you. I want show my demo to you. Looking forward your reply. Thank you. Best regards.

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

Hi I have more (around 10 years)experience in C programming. Looking forward your reply. Thanks and Regards Guna

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

A proposal has not yet been provided

$15 USD in 2 dage
(0 bedømmelser)
0.0
BArmin

A proposal has not yet been provided

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

Hello. I am a new freelancer. I am C++ developer and have a experience of program develop. I understand your requirement and can do it. If you award me, I will not let you down. Thank you for your attention.

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

hello, I have already the solution(algorithm) using graph representation, the implementation in C++ must take one day. Pascual.

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

Hello, I have good knowledge and experience of 9 years in "C" & "C++" in software industry. This is my first bid as freelancer and would like you to consider me. Also I have appeared in C & C++ exam on [url removed, login to view] Mere

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