Samba
InterviewTime limit1sMemory limit64 MB
Given the school IDs of n dancers, find the single school whose total dancer count is not a multiple of k.
Problem
Every year, Rio de Janeiro hosts a grand samba dance festival. This year, dancers from samba schools around the world perform in the streets, trying to impress the crowd with both their dancing and their costumes.
Each samba school is represented by exactly one group of dancers and has a unique identification number (ID). Every member of a school wears that same ID while moving in formation.
To keep the formations tidy, the organizers require each school to arrange all of its dancers into rows of exactly dancers. A school with dancers can do this only when is a multiple of .
Exactly one samba school is unable to arrange its dancers under this rule. Given the school ID worn by each of the dancers, determine that school's ID.
Input
The first line contains two space-separated integers and .
Each of the next lines contains one integer — the ID of the school that the -th dancer belongs to.
Output
Print a single integer: the ID of the one samba school whose number of dancers is not a multiple of .
Constraints
- Exactly one school has a dancer count that is not a multiple of .
Hint
Suppose there are dancers from schools , , and , with . School has dancers ( rows of ) and school has dancers ( row of ). School has dancers, which cannot be split into rows of exactly , so the answer is its ID, .