CF670B Game of Robots
题目描述
有$n(n\leq100000)$个机器人,每个机器人都有一个唯一的整数序号,该序号在$1$到$10^9$之间。他们在做一个叫“滚雪球”的游戏,即第一个机器人说出第一个机器人的序号,第二个机器人说出第一到第二个机器人的序号,第三个机器人说出第一到第三个机器人的序号……以此类推。求第$k(k\leq min(2\cdot10^9,n\cdot(n+1)/2)$个被说出的序号。
输入格式
第一行包含两个整数$n$和$k$(范围如上所述)。
第二行包含$n$个整数,第$i$个整数代表第$i$个机器人的序号。
输出格式
一行,包含第$k$个被说出的序号
说明/提示
In the first sample identifiers of robots will be pronounced in the following order: $ 1 $ , $ 1 $ , $ 2 $ . As $ k=2 $ , the answer equals to $ 1 $ .
In the second test case identifiers of robots will be pronounced in the following order: $ 10 $ , $ 10 $ , $ 4 $ , $ 10 $ , $ 4 $ , $ 18 $ , $ 10 $ , $ 4 $ , $ 18 $ , $ 3 $ . As $ k=5 $ , the answer equals to $ 4 $ .