#K93867. Find the Missing ID
Find the Missing ID
Find the Missing ID
You are given two lists of positive integers. The first list contains the IDs of persons who were invited to an event, and the second list contains the IDs of those who actually registered. Exactly one ID from the invited list is missing in the registered list. Your task is to find and output the missing ID.
You can solve this problem using the formula \[ \text{missing} = \sum_{i=1}^{N} a_i - \sum_{j=1}^{N-1} b_j \] where \(a_i\) represents the invited IDs and \(b_j\) represents the registered IDs.
inputFormat
The input is provided via stdin in the following format:
- An integer \(N\) indicating the number of invited IDs.
- A line containing \(N\) space-separated integers representing the invited IDs.
- An integer \(M\) (which should be \(N - 1\)) representing the number of registered IDs.
- A line containing \(M\) space-separated integers representing the registered IDs.
outputFormat
Output the missing invited ID to stdout.
## sample5
1 2 3 4 5
4
2 1 4 5
3