405920: GYM102157 1 Nuclear Reactor

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

1. Nuclear Reactortime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Dream Land has $$$n$$$ nuclear reactor plants. Each of the plants is positioned on a straight line $$$p_{i}$$$ ($$$ 1 \le p_{i} \le 10^{18} $$$) At the beginning, all plants are inactive. The president of Dream Land wants to activate exactly $$$k$$$ ($$$ 1 \le k \le n $$$) plants in such away the distance between any two active plants is as large as possible. The president assigned this task to you.

Input

The first line of input consist of two integers $$$n$$$ ($$$ 1 \le n \le 10^{5} $$$) and $$$k$$$ ($$$ 1 \le k \le n $$$), the number of nuclear plants and the number of activated plants respectively. The second line consist of $$$n$$$ integers which are the positions of the nuclear reactor plants $$$p_{i}$$$ ($$$ 1 \le p_{i} \le 10^{18} $$$).

Output

The output consist of exactly $$$k$$$ integers the positions of activated plants such as the distance between any two activated plants is as large as possible. If there are multiple answers, print any of them.

ExampleInput
5 3
4 5 11 8 10
Output
5 8 11

加入题单

上一题 下一题 算法标签: