Coding-Riddles/coal_counting.py
2025-01-20 11:37:00 -05:00

12 lines
No EOL
309 B
Python

from bisect import bisect_left
num_children, years = tuple(map(int, input("").split(" ")))
children = sorted(map(int, input("").split(" ")))
coal_thresholds = list(map(int, input("").split(" ")))
for threshold in coal_thresholds:
coal = num_children - bisect_left(children, threshold)
print(coal)