Santa Claus
InterviewTime limit2sMemory limit512 MB
Given two lists of children who already have presents, output the children from 1 to n who are missing from both lists.
- Level
Easy2 of 10
- Topics
- Array, Implementation, Hash map
- Solved
- No attempts yet
Problem
Santa Claus is getting ready for Christmas. On this holiday he wants to give presents to children. His assistant elves have already packed two bags that he will take on his New Year trip around all the countries of the world. So that Santa does not get confused, the elves made a list of the children whose presents are already in each bag. Santa wants to help the elves, so he decided to put into a third bag the presents for the children for whom they have not been prepared yet.
Help Santa and make a list of the children whose presents must be put into the third bag.
Input
The first line of the input file contains three integers: , the number of children, and and , the number of presents in the first and second bag respectively (; ). The second line of the input file contains integers: the numbers of the children whose presents are in the first bag. The third line of the input file contains integers: the numbers of the children whose presents are in the second bag.
The elves put at most one present for each child. All children's numbers are positive integers not exceeding . Every child must receive a present at Christmas, otherwise Santa will be upset.
Output
In the first line print a single number : how many presents must be in the third bag. In the second line print numbers in arbitrary order: the numbers of the children to whom these presents must be delivered.