There are bamboos shaped like line segments on the coordinate plane. The two endpoints of bamboo are and . Bamboos may overlap each other.
The bamboos are cut along the line . If a bamboo meets this line at a point that is not an endpoint, it is split into two pieces. If it meets the line only at an endpoint or does not meet it at all, it is not split.
Find the number of bamboos that are split into two pieces.
The input is given in the following format.
For each test case, print the number of split stalks on one line.
is the number of test cases.
Each test case is given in the following format.
is the number of bamboos. In the following lines, the coordinates of both endpoints of each bamboo are given.