A regional distribution center keeps a live list of loading docks that are currently in operation. Over time some docks get decommissioned, but nobody goes back and updates the staff roster, so a handful of employees end up "assigned" to a dock that no longer exists. You've been asked to sweep the roster and flag exactly those employees so facilities can reassign them.
D, the number of currently active docks.D space-separated integers, the IDs of the active docks (all distinct). No tokens appear on this line when D = 0.E, the number of employees on the roster.E groups each contribute three whitespace-separated tokens: an integer employee ID, the employee's name (a single token with no spaces), and an integer dock ID the employee is currently assigned to.Print one line <employee_id> <name> for every employee whose assigned dock ID is not among the active dock IDs, ordered by ascending employee ID. If no employee qualifies, print nothing.
a-z, A-Z)Example 1
Input
3 10 20 30 4 1 alice 10 2 bob 25 3 carol 20 4 dave 99
Expected
2 bob 4 dave
Explanation
Docks 10, 20, and 30 are active. Alice (dock 10) and Carol (dock 20) are assigned to active docks, but Bob is assigned to dock 25 and Dave to dock 99 -- neither dock is active, so both are flagged. Sorted by employee ID, the output is `2 bob` followed by `4 dave`.
Example 2
Input
2 5 6 2 100 zack 5 101 amy 6
Expected
(empty)Explanation
Docks 5 and 6 are active. Zack is assigned to dock 5 and Amy to dock 6 -- both docks are active, so neither employee is flagged and the output is empty.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →