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

16728번 - Chaarshanbegaan at Cafebazaar 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB27020017774.370%

문제

Chaarshanbegaan is a gathering event at Cafebazaar similar to TGIF events at Google. Some entertainment programs like pantomime, foosball, Xbox/PS4, and several board games are part of the event. You are going to set up a dart game in Chaarshanbegaan. As a techie organizing a game for techies, you would rather use a smart screen and write a program to calculate the scores instead of hanging a traditional dartboard and scoring the shots manually. Your program must get the coordinates of dart shots for a player and calculate his/her total score. The score for each dart shot (at point (x, y)) is calculated based on its distance from the center of the dartboard (point (0, 0)). If the distance is d millimeters, the score is calculated based on the following table:

입력

The first line of the input contains a single integer N as the number of dart shots for a player (1 ≤ N ≤ 100). Each of the next N lines contains two space-separated integers as the coordinates (x, y) of a dart shot. The coordinates are in millimeters and their absolute values will not be greater than 300.

출력

Print a single line containing the total score of the player.

제한

예제 입력 1

2
4 7
-31 -5

예제 출력 1

18

예제 입력 2

3
12 -16
-180 100
152 10

예제 출력 2

11

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > Tehran Site 2018 B번

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

출처

대학교 대회

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

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