logo AlgoBeat OnlineJudge
登录 注册

#215600. [CERC2012] Darts

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 () if the smallest circle enclosing or passing through the hit point is the one with radius . 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.

输入格式

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 (). Each of the next lines contains two integers and () separated by a space—the coordinates of the point hit by a throw.

输出格式

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.

样例

样例输入 1

1
5
32 -39
71 89
-60 80
0 0
196 89

样例输出 1

29