Spring has arrived, ushering in a season of hard work at the Swarm of Bees Company (SBC). With the blooming of $$$N$$$ beautiful flowers in the garden, each flower boasts a certain quantity of pollen grains. The SBC enforces strict rules to keep the bees industrious in their pollen collection.
Gertrude finds these rules bewildering and seeks help to determine the pollen amount she must collect when it's her turn. Getrude has amazingly sharp sight and noticed that she is currently the $$$K$$$-th bee in the SBC-defined order.
The first line contains two integers $$$N$$$ ($$$1 \le N \le 10^6$$$) and $$$K$$$ ($$$1 \le K \le 10^9$$$), representing the number of flowers and Gertrude's position in the bee line, respectively. The second line contains $$$N$$$ integers, where the $$$i$$$-th integer $$$F_i$$$ ($$$1 \le F_i \le 10^6$$$ for $$$1 \le i \le N$$$) denotes the initial quantity of pollen grains of the $$$i$$$-th flower.
Output a single integer $$$Q$$$ representing the amount of pollen Gertrude will collect.
5 3 22 15 7 2 1
6
3 10 21 21 21
0
3 9 21 21 21
9
Name |
---|