~/algor $ cat problems/kichik-yoki-teng
Less than or equal
Medium
2000 ms
128 MB
45%
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$.
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