시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 192 74 54 39.706%

문제

꿍이 군생활을 하다가 심심해져서 다트게임을 만들어서 하려고 한다. 그래서 보드에 그려진 다트게임을 생각해보자. 보드에는 중심이 원점이고 반지름이 20,40,60,80,100,120,140,160,180,200(단위는 mm)인 10개의 원이 그려져 있다. 각각의 화살은 꽂힌 지점을 감싸는 가장 가까운 원(경계선에 꽂힌 경우도 포함)의 반지름이 20*(11 − p)인 경우 p점을 획득한다.(p ∈ {1, 2, ... , 10}) 만약 가장 큰 원 바깥에 꽂혔다면 얻는 점수는 없다.

여러분은 꿍이 n개의 화살을 던져 총 몇점을 얻는지 계산해주면 된다.

입력

입력의 첫번째 줄에는 테스트 케이스의 개수 T가 주어진다.

각 테스트케이스의 경우 첫줄에 n (1 ≤ n ≤ 10^6)이 주어진다. 다음 n줄에는 맞은 지점의 좌표인 두 개의 정수 x, y (−200 ≤ x, y ≤ 200)가 공백으로 구분되어 주어진다.

출력

테스트 케이스가 주어지는 순서대로 정답을 출력한다. 각 테스트케이스에 대해, 각 줄에 n개의 화살을 던져 얻는 총 점수를 하나의 정수로 각 줄에 출력한다.

예제 입력 1

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

예제 출력 1

29
W3sicHJvYmxlbV9pZCI6IjM0MTIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIyZTRcdWQyYjhcdWFjOGNcdWM3ODQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWZjZFx1Yzc3NCBcdWFkNzBcdWMwZGRcdWQ2NWNcdWM3NDQgXHVkNTU4XHViMmU0XHVhYzAwIFx1YzJlY1x1YzJlY1x1ZDU3NFx1YzgzOFx1YzExYyBcdWIyZTRcdWQyYjhcdWFjOGNcdWM3ODRcdWM3NDQgXHViOWNjXHViNGU0XHVjNWI0XHVjMTFjIFx1ZDU1OFx1YjgyNFx1YWNlMCBcdWQ1NWNcdWIyZTQuIFx1YWRmOFx1Yjc5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