Under construction

Still being built. Things may change

Olympic Parade

Interview

Time limit1sMemory limit256 MB

Summary
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 (1≤N≤1061 \le N \le 10^6, 2≤K≤N2 \le K \le N).

Each of the next N lines contains one ID, giving C1,C2,…,CNC_1, C_2, \dots, C_N (0≤Ci≤1090 \le C_i \le 10^9) for the N people.

Output

Print the ID of the university that could not line up, on a single line.

Examples1

  1. Example 1

    Input
    10 3
    1
    1
    2
    3
    1
    3
    3
    2
    2
    2
    
    Expected output
    2