Logo
(追記) (追記ここまで)

3412번 - Darts 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB66631324748.718%

문제

Consider a game in which darts are thrown at a board. The board is formed by 10 circles with radii 20, 40, 60, 80, 100, 120, 140, 160, 180, and 200 (measured in millimeters), centered at the origin. Each throw is evaluated depending on where the dart hits the board. The score is p points (p ∈ {1, 2, ... , 10}) if the smallest circle enclosing or passing through the hit point is the one with radius 20 · (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 n throws.

입력

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

Each test case starts with a line containing the number of throws n (1 ≤ n ≤ 106). Each of the next n lines contains two integers x and y (−200 ≤ x, y ≤ 200) 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 n throws.

제한

예제 입력 1

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

예제 출력 1

29

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2012 H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /