John loves programming contests. There is just one problem: his team is not very good at programming. This usually doesn't bother him, but what does bother him is that everyone gets a balloon for every correct submission. John's team never gets any balloons, while other teams get one balloon after another. This frustrates him, so John would like all other teams to have no balloons either.
This year he has a plan to achieve exactly that. John has hired a ninja to pop all the balloons for him. At any time during the contest, he can call the ninja, who comes down through a hole in the ceiling, pops the balloons with his shurikens (ninja stars), and then leaves through the hole again. Of course the ninja wants to use as few of his precious shurikens as possible. Therefore, John must write a program that computes how many shurikens are needed to pop all the balloons.
Because all balloons are at approximately the same height, the problem can be modeled in two dimensions. The ninja's entry point is the origin $(0, 0)$, and each balloon is modeled as a circle; to be safe, these circles may have different radii. A shuriken is thrown from the origin and travels in a straight line, so it is a halfline rooted at the origin. Every circle (balloon) crossed by this halfline is popped. The question becomes: what is the minimum number of halflines rooted at the origin needed to cross all of the circles?
The first line of the input contains the number of test cases. Each test case has the following format:
You may assume that any two halflines rooted at the origin that are tangent to two distinct circles make an angle of at least $10^{-6}$ radians at the origin. Moreover, the circles do not cross each other (though they may touch) and do not contain the origin.
For each test case, output a single line containing one integer: the minimum number of shurikens the ninja needs to pop all the balloons.
The second example was illustrated by a figure in the original problem.
Disclaimer: No balloons were harmed during the making of this problem.