#K92932. RSVP Processing
RSVP Processing
RSVP Processing
You are given two lists: a list of invited people and a list of RSVP responses. Your task is to determine which invitees confirmed their attendance and which did not.
Let \(I\) be the set of unique invitees and \(R\) be the set of RSVP responses. An invitee is confirmed if they appear in \(R\), and not confirmed otherwise. The output should list the confirmed invitees and the not confirmed invitees in lexicographical order.
Note: The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains two integers \(n\) and \(m\) separated by a space, where \(n\) is the number of invite entries and \(m\) is the number of RSVP responses.
The following \(n\) lines each contain the name of an invitee. Names may appear more than once.
After that, the next \(m\) lines each contain the name of a person who has sent an RSVP response. Names may also appear more than once.
All names are non-empty strings without spaces.
outputFormat
Output two lines:
- The first line should contain the confirmed invitees in lexicographical order, separated by a single space. If there are no confirmed invitees, output an empty line.
- The second line should contain the invitees who have not confirmed their attendance in lexicographical order, separated by a single space. If all invitees have confirmed, output an empty line.
5 4
Alice
Bob
Charlie
Alice
Eve
Charlie
Alice
Eve
Eve
Alice Charlie Eve
Bob
</p>