Submit | All submissions | Best solutions | Back to list |
Problem hidden
LINES2 - LINES2 |
There are n army camps on a straight line along the border. You are given the start point and the end point of each camp. There will be k queries having a point each and you need to output the number of camps overlapping at that point.
Input
The first line contains 2 integers n and k. n denotes the number of army camps and k the number of queries.
n lines follow each containing 2 integers, say x and y denoting a line segment from x to y denoting an army camp starting from x and ending at y(both inclusive)
Following this there are k lines each containing a single integer denoting the point
Output
For each of the k queries, output a single line containing the number of camps that overlap at that point.
1<= n,k <= 100000
All x and y fir within a 32-bit integer
Example
Input: 3 1 1 4 3 11
8 9
8
Output: 2
Added by: | priyamehtanit |
Date: | 2012-01-22 |
Time limit: | 0.102s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | own |