- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
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 ) is calculated based on its distance from the center of the dartboard (point ). 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 as the number of dart shots for a player (). Each of the next lines contains two space-separated integers as the coordinates of a dart shot. The coordinates are in millimeters and their absolute values will not be greater than .
خروجی
Print a single line containing the total score of the player.
مثال
ورودی نمونه ۱
خروجی نمونه ۱
ورودی نمونه ۲
خروجی نمونه ۲
ارسال پاسخ برای این سؤال