Marisa plays poker - MarisaOJ: Marisa Online Judge

Marisa plays poker

Time limit: 3000 ms
Memory limit: 256 MB
Given an array A of n integers, there are q queries, each falling into one of two types: - 1lrk: Find the k-th smallest number in the subarray Al...r. - 2lrx: For every l≤i≤r, increment Ai by x. Find the answers for each query of type 1. ### Input - The first line contains two integers n,q. - The second line contains n integers Ai. - The next q lines each contain a query in the specified format. ### Output - Print an integer as the answer for each query of type 1. ### Constraints - 1≤n,q≤105. - 0≤|Ai|,|x|≤2×104. - 1≤k≤r−l+1. ### Example Input: 1111111 Output: 1