PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000006. Truy vấn số phần tử không lớn hơn (Queries about less or equal elements)
HỌC THEO LỘ TRÌNH
2 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Truy vấn số phần tử không lớn hơn (Queries about less or equal elements)
Queries about less or equal elements
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
You are given two integer arrays and . For every , count how many elements of satisfy .
Input
The first line contains and .
The second line contains the elements of .
The third line contains the elements of .
Output
Print integers. The -th answer is the number of .
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , .
Examples
Input
5 4
1 3 5 7 9
6 4 2 8
Output
3 2 1 4
Explanation
For , the values are not greater than , so the first answer is .