시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 257 103 66 37.931%

문제

꿍이 군생활을 하다가 심심해져서 다트게임을 만들어서 하려고 한다. 그래서 보드에 그려진 다트게임을 생각해보자. 보드에는 중심이 원점이고 반지름이 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
W3sicHJvYmxlbV9pZCI6IjM0MTIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIyZTRcdWQyYjhcdWFjOGNcdWM3ODQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWZjZFx1Yzc3NCBcdWFkNzBcdWMwZGRcdWQ2NWNcdWM3NDQgXHVkNTU4XHViMmU0XHVhYzAwIFx1YzJlY1x1YzJlY1x1ZDU3NFx1YzgzOFx1YzExYyBcdWIyZTRcdWQyYjhcdWFjOGNcdWM3ODRcdWM3NDQgXHViOWNjXHViNGU0XHVjNWI0XHVjMTFjIFx1ZDU1OFx1YjgyNFx1YWNlMCBcdWQ1NWNcdWIyZTQuIFx1YWRmOFx1Yjc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