SP188 RECTNG1 - Rectangles
Description
There are _n_ rectangles drawn on the plane. Each rectangle has sides parallel to the coordinate axes and integer coordinates of vertices.
We define a block as follows:
- each rectangle is a block,
- if two distinct blocks have a common segment then they form the new block otherwise we say that these blocks are separate.
Input Format
The number of test cases _t_ is in the first line of input, then _t_ test cases follow separated by an empty line.
In the first line of a test case there is an integer _n_, 1
Output Format
For each test case you should output one line with the number of separate blocks formed by the given rectangles.