31.07.2015 Views

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

43Input Output Explanation3 4 342 42 32 21 3One of the possible variants of cutting4 4 451 13 32 24 41 4One of the possible variants of cutting225. Acquaintances. N guests were supposed to attend the event. Guests are namedwith numbers from 1 to N.It was known in advance which of these persons were familiar to each other. Twopersons would certain became acquainted with each other during the event, if they hador made common acquaintance during the event.Organizers of the event, knowing the situation were sure that all guests would becameacquainted. But one person did not attend the event and not all the guests becameacquainted.Task. Write a program to determine the guest who did not attend the event.Input. The first line of the input file contains contain the number of guests N(2 < N ≤ 200). The first number of the secondline is the number of persons the first personwas familiar with before event. Further there arepresented the numbers of the guests the firstguest knew. The third line contains the numberof persons the second person is familiar withand etc.Output – the number of absent guest – mustbe written to the result file.Note. If several solutions (absent persons)exist, output any one of them.Input72 2 72 1 42 4 54 2 3 6 72 3 62 4 52 1 4ExampleOutput4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!