Description

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.

Input

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 (1n106). Each of the next n lines contains two integers x and y (- 200x, y200) separated by a space -- the coordinates of the point hit by a throw.

Output

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.

Sample Input

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

Sample Output

29
 #include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int d(int a,int b)
{
if(*<(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
return ;
}
int main()
{
int n;
cin>>n;
while(n--)
{
int m,ans=;
cin>>m;
while(m--)
{
int a,b;
scanf("%d%d",&a,&b);
ans+=d(a,b);
}
printf("%d\n",ans);
}
return ;
}

UVALive 6262 Darts的更多相关文章

  1. UVALive - 4108 SKYLINE[线段树]

    UVALive - 4108 SKYLINE Time Limit: 3000MS     64bit IO Format: %lld & %llu Submit Status uDebug ...

  2. UVALive - 3942 Remember the Word[树状数组]

    UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...

  3. UVALive - 3942 Remember the Word[Trie DP]

    UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...

  4. 日本DARTS 支撑的一系列应用项目

    DARTS是多学科空间科学数据平台,例如天体物理.太阳物理.太阳物理.月球与行星科学和微重力科学.在此数据支撑下,有许多应用. 1.http://wms.selene.darts.isas.jaxa. ...

  5. 思维 UVALive 3708 Graveyard

    题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...

  6. UVALive 6145 Version Controlled IDE(可持久化treap、rope)

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...

  7. UVALive 6508 Permutation Graphs

    Permutation Graphs Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit ...

  8. UVALive 6500 Boxes

    Boxes Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Pract ...

  9. UVALive 6948 Jokewithpermutation dfs

    题目链接:UVALive 6948  Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...

随机推荐

  1. style一张图--openlayers

  2. linux(vi)常用命令

    常用操作 系统命令 查看主机名 hostname 修改主机名(重启后无效) hostname yang 修改主机名(重启后永久生效) vi /ect/sysconfig/network 修改IP(重启 ...

  3. three.js是什么,能干嘛,和webgl什么关系

    如今浏览器的功能越来越强大,而且这些功能可能通过JavaScript直接调用.你可以用HTML5标签轻松地添加音频和视频,而且可以在HTML5画布上创建各种交互组件.现在这个功能集合里又有了一个新成员 ...

  4. opencv(3)视频操作

    视频中最常用的就是从视频设备采集图片或者视频,或者读取视频文件并从中采样.所以比较重要的也是两个模块,一个是VideoCapture,用于获取相机设备并捕获图像和视频,或是从文件中捕获.还有一个Vid ...

  5. Codefroces 628B New Skateboard(数位+思维)

    题目链接:http://codeforces.com/contest/628/problem/B 题目大意:给你一段数字串s(1?≤?|s|?≤?3·10^5),求该字符串有多少子串是4的倍数.解题思 ...

  6. Java多线程-Java多线程概述

    第一章 Java多线程概述 线程的启动 线程的暂停 线程的优先级 线程安全相关问题 1.1 进程与线程 进程:可以将运行在内存中的程序(如exe文件)理解为进程,进程是受操作系统管理的基本的运行单元. ...

  7. LeetCode282. Expression Add Operators

    Given a string that contains only digits 0-9 and a target value, return all possibilities to add bin ...

  8. 20165203实验四 Andriod程序设计

    20165203实验四 Andriod程序设计 实验内容 安装 Android Stuidio 学习Android Stuidio调试应用程序 实验要求 1.没有Linux基础的同学建议先学习< ...

  9. CVE-2009-3459

     Adobe Acrobat和Reader都是美国Adobe公司开发的非常流行的PDF文件阅读器.         Adobe Reader和Acrobat 7.1.4之前的7.x版本,8.1.7之前 ...

  10. Nginx 虚拟主机 VirtualHost 配置

    Nginx 是一个轻量级高性能的 Web 服务器, 并发处理能力强, 对资源消耗小, 无论是静态服务器还是小网站, Nginx 表现更加出色, 作为 Apache 的补充和替代使用率越来越高. 我在& ...