def add(a,b): for i in xrange(a-1,b): box[i]+=1 def count(k): if box.count(k)!=0: box.index(k) return len(box)-box.index(k) else: return 0 from sys import stdin,stdout box=[0]*int(stdin.readline()) for i in xrange(int(stdin.readline())): a,b = stdin.readline().split() add(int(a),int(b)) box.sort() for i in xrange(int(stdin.readline())): print count(int(stdin.readline()))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)