PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000089. Đếm học sinh đạt ngưỡng chiều cao (Counting 2)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm học sinh đạt ngưỡng chiều cao (Counting 2)
Counting 2
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
A class has students of heights . For each of independent thresholds , count students whose heights are at least .
Input
The first line contains and . The second line contains heights. Each of the next lines contains one threshold.
Output
Print lines; the -th line is the number of heights at least .
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
3 1
100 160 130
120
Output
2
Explanation
The heights are . The threshold is met by and , but not , so the count is .