In this problem, we define an interval [a..b] as a continuous one-dimensional area form number a to b.
you are asked to calculate the number of interval pairs that overlap each other among a set of given intervals. All intervals are located in a number line, and all their endpoints are integers.
The first line contains one number N, where 2 <= N <= 256, standing for the number of given intervals.
Each of the following N lines describes an interval and has 2 integers separated by space, representing
For each interval, you may assume the coordinate of the left vertex is smaller than the one of the right vertex.
Notice that each of the 2 numbers is representable by an int type in C language.
The output should contain only one number, representing the number of interval pairs that intersect to each other.
Notice that if the overlapping part is of zero length, then the pair should NOT count.