Submit | All submissions | Best solutions | Back to list |
EI20213Q3 - Compare with K |
You are given n integers and m query. For each query, you are given a number b, you should output the number of elements among given integers that less than or equal to b.
Input
- The first line contains two integers n, m (1 ≤ n, m ≤ 105).
- The second line contains n integers (-109 ≤ ai ≤ 109).
- The third line contains m integers representing m queries (-109 ≤ bj ≤ 109).
Output
For each query, output the number of elements in a that less than or equal to b.
Sample
https://drive.google.com/file/d/1F2NB_Z_uJG3avJO4sb-uUTbPWK0QQePS/view?usp=sharing
Input |
Output |
5 3 0 3 5 6 9 4 2 8 |
2 1 4 |