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. linux 进程内存解析【转】

    转自:http://blog.csdn.net/lile269/article/details/6460807 之前我所了解的linux下进程的地址空间的布局的知识,是从APUE第2版的P430得来的 ...

  2. select()函数用法一

    select()函数用法以及FD_ZERO.FD_SET.FD_CLR.FD_ISSET select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用 ...

  3. 2018ICPC南京网络赛

    2018ICPC南京网络赛 A. An Olympian Math Problem 题目描述:求\(\sum_{i=1}^{n} i\times i! \%n\) solution \[(n-1) \ ...

  4. Operfire 安装指南

    http://www.cnblogs.com/hoojo/archive/2012/05/13/2498151.html 本文的英文原文来自 http://www.igniterealtime.org ...

  5. python网络编程-socket样例

    socket样例 一:只能一个客户端发送一个信息. 客户端 # -*- coding:utf-8 -*- __author__ = 'shisanjun' import socket sock=soc ...

  6. 手淘移动适配方案flexible.js兼容bug处理

    什么是flexible.js 移动端自适应方案 https://www.jianshu.com/p/04efb4a1d2f8 什么是rem 这个单位代表根元素的 font-size 大小(例如 元素的 ...

  7. 签名DLL

    签名DLL 首先需要一个密钥文件,后缀为.snk 密钥文件使用sn.exe 创建: sn.exe /k MySingInKey.snk  sn.exe 工具的具体使用,可以通过 sn.exe /h 或 ...

  8. JS实现幸运抽奖页面

    JS实现简单的幸运抽奖页面 效果图: 图片素材 : 代码如下,复制即可使用: <!DOCTYPE html> <html> <head lang="en&quo ...

  9. 为通过 ATS 检测 Tomcat 完全 TLS v1.2、完全正向加密及其结果检验

    2017 年起 app store 要求 app 对接的服务器支持 TLS v1.2,否则 ats 检测不予通过.有点强制推 TLS v1.2 的意味.本文介绍如何使 tomcat 强制执行 TLS ...

  10. JS正则表达式方法

    使用正则表达式的主要有match,exec,test 1.正则表达式方法test测试给定的字符串是否满足正则表达式,返回值是bool类型的,只有真和假. var user_code = $(" ...