All submissions for this problem are available.
Voting is an important part of any democratic system. A newly appointed collector of a city has been assigned with a task of constructing the voter's list of his city. A task which is prone to errors. Some voters may have been away on vacation, others may have moved during the enrollment and so on. In order to be as accurate as possible he entrusted this task to three different officials. These were to independently record the list of voters and send it to him. In this city, every one has a ID number and the list would only list their ID nos and no names. The officials were expected to arrange the ID numbers in ascending order in their lists. When the collector receives the list, he realised there were discrepencies. The three lists were not identical.So he has called upon you to create a program for him which is capable of selecting those IDs which are in majority,i.e. they appear in the list at least 2 out of 3 times.
The first line of the input contains 3 integers N1, N2 and N3, N1 is the number of voters as counted by official 1, N2 is the number of voters as counted by official 2, N3 is the number of voters counted by official3.Then next N1 lines contain one positive integer each and describe the first list in ascending order. This is followed by N2 lines describing the second list and so on by N3 lines describing the thirs list in ascending orders.
The first line of the output should contain a single integer M indicating the number of voters in the final list, followed by M lines that contain one positive integer each, describing the list of voters in the final list in ascending order.
Input: 3 3 3 23 30 42 21 23 35 21 23 30 Output: 3 21 23 30
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 4.9.2, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.4, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions