Darts#4135

Darts

3 seconds
256 megabytes
Very easy

Consider a game in which darts are thrown at a board. The board is formed by circles with radii , , , , , , , , and (measured in millimeters), centered at the origin. Each throw is evaluated depending on where the dart hits the board. The score is points (p \in \{1, 2, \ldots, 10\}) if the smallest circle enclosing or passing through the hit point is the one with radius 20 \cdot (11-p). No points are awarded for a throw that misses the largest circle.

Your task is to compute the total score of a series of throws.

Input

The first line of the input contains the number of test cases . The descriptions of the test cases follow:

Each test case starts with a line containing the number of throws (1 \le n \le 10^6). Each of the next lines contains two integers and (-200 \le x, y \le 200) separated by a space — the coordinates of the point hit by a throw.

Output

Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing one integer — the sum of the scores of all throws.

Examples

Example 1

Loading
Loading