Processing math: 100%
Yet another problem - MarisaOJ: Marisa Online Judge

Yet another problem

Time limit: 1000 ms
Memory limit: 256 MB
Given an array A of n integers and q queries, each is an integers k. For each query, find the longest subarray contains only elements not bigger than k. ### Input - The first line contains 2 integers n,q. - The second line contains n integers Ai. - The next q lines, each line contains an integer k, a query. ### Output - Print q lines, the ith is the answer to query i. ### Constraints - 1≤n≤105. - 0≤|Ai|,|k|≤109. ### Example Input: 64-25610-50-105-411 Output: 0216