Pique Esconde
Time limit0.5sMemory limit1024 MB
Given n children, the searcher m, and the n-2 children already found, output the number of the one child still missing.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
João enjoys computers and wonders what a program that automates everything he does each day would look like. Maria challenged him to write a program that would be useful in some way when they play hide-and-seek.
João has a good idea for a program, but he is still in his first computer science classes and does not yet know how to implement it. Please help him.
João's idea is to number the children taking part in the game from 1 to . The program receives the total number of children and the number of the child who is searching for the others. Then it receives a list of numbers identifying the children who have already been found, and it must output the number of the child who is still missing.
Input
The first line of each test case contains , the number of children, and , the number of the child who is searching for the others, with and . Each of the next lines contains one integer, the number of a child who has already been found.
The input ends with a line containing . Do not process this line.
Output
For each test case, print one line containing the number of the child who has not been found yet.