#K69922. Maximum Challenges Solved
Maximum Challenges Solved
Maximum Challenges Solved
In this problem, you are given N participants and M challenges. Each participant has a skill level, and each challenge has a difficulty level. A participant can solve a challenge if and only if the participant's skill level is greater than or equal to the challenge's difficulty. For each participant, count the number of challenges they can solve.
The mathematical formulation for each participant i is:
$$count_i = \sum_{j=1}^{M} \mathbf{1}\{difficulty_j \leq skill_i\}$$
where \(\mathbf{1}\{\cdot\}\) is the indicator function.
inputFormat
The input is given via standard input and consists of three lines:
- The first line contains two integers N and M separated by a space.
- The second line contains N integers representing the skill levels of the participants.
- The third line contains M integers representing the difficulties of the challenges.
outputFormat
Output a single line containing N integers separated by spaces, where the i-th integer is the number of challenges that the i-th participant can solve.
## sample5 4
50 60 70 80 90
40 50 60 70
2 3 4 4 4