Olympic Parade
InterviewTime limit1sMemory limit256 MB
Find the ID that does not appear a multiple of K times among N given IDs.
- Level
Easy3 of 10
- Topics
- Hash map
- Solved
- No attempts yet
Problem
The organizing committee decided to open this year's ceremony with a parade of contestants through the city streets. N people (contestants, coaches and guests) representing universities from the participating countries walk the streets in original costumes, singing loudly. Every university takes part as one group, and each person in that group carries the unique identifier (ID) of that university. To keep the parade orderly, every group lines up in several rows of exactly K people.
Exactly one university could not line up that way. Find its ID.
Input
The first line contains two integers N and K separated by a single space (, ).
Each of the next N lines contains one ID, giving () for the N people.
Output
Print the ID of the university that could not line up, on a single line.