I need to solve the following task as a subtask of another problem. So I need your HELP.
I need a Data Structure that can do the following operations:
Add a pair of integers (x,y) in the Data Structure.
For a given pair (a,b) it will give me the count of the number of pairs (x,y) such that x<=a and y<=b.
Note: Maximum Time Complexity for both of the operations can be at most O(log n).
Trivia: (not for this problem) I am interested if there is a solution with erase operation.