Not many know that after the events of the popular fairy tale, Goldilocks took up a job as the official porridge chef for the bear family to pay for her Deepseek subscription. Business was simple at first, but the bear family has grown quite large, and their breakfast demands are getting out of hand.
To make things easier, they've given Goldilocks a list of the temperature ranges each bear finds just right. Now, Goldilocks is wondering how many bears she could satisfy by preparing porridge at some specific temperatures. Help her answer these queries!
The first line contains two integers $$$n$$$ and $$$q$$$ ($$$1 \leq n, q \leq 10^5$$$) — the number of bears and the number of temperature queries.
The next $$$n$$$ lines contain two integers $$$l_i$$$ and $$$r_i$$$ ($$$1 \leq l_i \leq r_i \leq 10^9$$$), representing the temperature range $$$[l_i, r_i]$$$ that the $$$i$$$-th bear finds acceptable (note that this range is inclusive).
The next $$$q$$$ lines each contain a single integer $$$t_i$$$ ($$$1 \leq t_i \leq 10^9$$$) — a porridge temperature for which Goldilocks wants to know how many bears will be satisfied.
For each query temperature $$$t_i$$$, output a single integer on a new line — the number of bears that will be satisfied with porridge at that temperature.
2 31 55 105611
2 1 0
At temperature $$$5$$$, both bears are satisfied — $$$5$$$ is in $$$[1,5]$$$ and $$$[5,10]$$$.
At temperature $$$6$$$, only the second bear is satisfied — $$$6$$$ is in $$$[5,10]$$$ but not $$$[1,5]$$$.
At temperature $$$11$$$, no bears are satisfied — $$$11$$$ is not in $$$[1,5]$$$ or $$$[5,10]$$$.