Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/kichik-yoki-teng

Less than or equal

Medium 2000 ms 128 MB 45%
Share

An array $a$ of $n$ integers and $q$ queries are given. Each query gives an integer $x$: find how many elements of the array are less than or equal to $x$.

Array cells: elements less than or equal to the given number are highlighted and counted

Input

The first line contains two positive integers: $n$ and $q$. The second line contains $n$ integers $a_{i}$ separated by spaces. Each of the next $q$ lines contains one integer $x$.

Output

$q$ lines: for each query one integer — the number of elements with $a_{i} \le x$.

Note

$1 \le n, q \le 10^{5}$
$-10^{9} \le a_{i}, x \le 10^{9}$

Examples

Input #1
5 3
1 5 2 5 9
5
0
10
Output #1
4
0
5
Input #2
1 2
7
7
6
Output #2
1
0

Sign in to submit a solution

Signing up is free and takes a minute.