TNVFC2O - Olympic

 

SEERC organizing committee decided to make this year’s opening ceremony in unusual way –
organize a parade of contestants on the city streets. This year N people (contestants, coaches
and guests), that represent universities from participating countries, will go on the streets, trying
to impress spectators by original costumes and loud songs. Each university is represented by a
group of people and has a unique identifier (ID) that is carried by each person in the group. To
make the parade well organised and entertaining, each group should be lined up in several rows,
each consisting of K people.
Only one university was not able to line up according to the mentioned rule, and you need to find
it’s ID.

This year N people (contestants, coaches and guests), that represent universities from participating countries, will go on the streets, trying

to impress spectators by original costumes and loud songs. Each university is represented by a

group of people and has a unique identifier (ID) that is carried by each person in the group. To

make the parade well organised and entertaining, each group should be lined up in several rows,

each consisting of K people.

Only one university was not able to line up according to the mentioned rule, and you need to find

it’s ID.

 

Input

The first line at input contains integer N and K, separated by a single space (1 ≤ N ≤ 1 000 000,

2 ≤ K ≤ 10^9). Following N lines contain IDs C 1 , C 2 , ... , C n (0 ≤ C i ≤ 1 000 000 000, 1 ≤ i ≤ N) of N

people.

Output

The single line at output should contain one integer – the answer for the problem.

Example

Input:
10 3
1
1
2
3
1
3
3
2
2
2

Output:
2

Added by:BIDV
Date:2017-09-24
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2018-05-29 16:50:15
Guys When I hit submit, I got "6.25" as result. What does that mean
2017-09-27 05:48:29 [Rampage] Blue.Mary
@BIDV
All of your problems are suitable for the "partial" section.
Please move them into "partial" section or change the Master Judge No. from 1001 to 1000.
2017-09-24 06:15:32
k>=2 && k<=1 ??? howz dat possible??
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.