Previous episode: 12155
After the "blackhole" incident, scientists accidentally found the potential energy of blackholes that created by the collision of multiple cat-toasts: the energy productivity of cat-toast blackhole is far more larger than cat-toasts.
By observing the cat-toast blackhole near the event horizon, they found that the collided cat-toasts weren't teared into slices but spinning around the blackhole. The scientists decided to call it "Nyan Cat". The Nyan Cat blackhole soon be wildly spread to the whole world.
Nyan Cat spinning around the blackhole
Recently, the scientists found that if there are too many Nyan Cat spinning around one blackhole, the huge angular momentum will form an unstable energy field, which would cause the Nyan Cat blackhole system crash, then all the nearby substance will be inhaled.
They soon set up a team to deal with the potential threat. If a cat-toast blackhole contains too many Nyan Cat spinning around it, they'll use catnip(貓薄荷) to lure it out.
You are in a power plant, whose energy source is the cat-toast blackhole. The power plant engineer gives you the original cat-toast location before they collide into a blackhole. You need to figure out the number of blackholes that is safety, and the number of blackholes that contains too many Nyan Cat.
There are nodes on an 2D-plane. If the distance of two nodes are equal to or closer than , they are in the same group.
You are given a number . You have to find out:
Note that the distance between two nodes and is:
where and are the coordinate of the two nodes, respectively.
The first line contains an integer , indicates the number of testcases.
In each testcase:
.
.
Output two numbers:
The number of groups with size less than ,and the number of groups with size equal to or greater than , seperate with a space.
Remember to print a newline at the end of the output.