#abc231c. C - Counting 2

C - Counting 2

Score : 300300 points

问题描述

存在一个包含 NN 名学生的班级。第 ii 名学生(1iN1 \leq i \leq N)的身高为 AiA_i

对于每个 j=1,2,,Qj=1,2,\ldots,Q,回答以下问题:

  • 按照题目要求,有多少名学生的身高不少于 xjx_j

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There is a class with NN students. The height of the ii-th student (1iN)(1 \leq i \leq N) is AiA_i.

For each j=1,2,,Qj=1,2,\ldots,Q, answer the following question.

  • How many of the NN students have a height of at least xjx_j?

Constraints

  • 1N,Q2×1051 \leq N,Q \leq 2 \times 10^5
  • 1Ai1091 \leq A_i \leq 10^9
  • 1xj1091 \leq x_j \leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN QQ

A1A_1 A2A_2 \ldots ANA_N

x1x_1

x2x_2

\vdots

xQx_Q

Output

Print QQ lines.

The jj-th line (1jQ)(1 \leq j \leq Q) should contain the number of students with a height of at least xjx_j.

Sample Input 1

3 1
100 160 130
120

Sample Output 1

2

The students with a height of at least 120120 are the 22-nd and 33-rd ones.

Sample Input 2

5 5
1 2 3 4 5
6
5
4
3
2

Sample Output 2

0
1
2
3
4

Sample Input 3

5 5
804289384 846930887 681692778 714636916 957747794
424238336
719885387
649760493
596516650
189641422

Sample Output 3

5
3
5
5
5

update @ 2024/3/10 10:04:42