FZU 2140 Forever 0.5(找规律,几何)
Problem 2140 Forever 0.5
Accept: 371 Submit: 1307 Special Judge
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
Given an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions:
The distance between any two points is no greater than 1.0.
The distance between any point and the origin (0,0) is no greater than 1.0.
There are exactly N pairs of the points that their distance is exactly 1.0.
The area of the convex hull constituted by these N points is no less than 0.5.
The area of the convex hull constituted by these N points is no greater than 0.75.
Input
The first line of the date is an integer T, which is the number of the text cases.
Then T cases follow, each contains an integer N described above.
1 <= T <= 100, 1 <= N <= 100
Output
For each case, output “Yes” if this kind of set of points exists, then output N lines described these N points with its coordinate. Make true that each coordinate of your output should be a real number with AT MOST 6 digits after decimal point.
Your answer will be accepted if your absolute error for each number is no more than 10-4.
Otherwise just output “No”.
See the sample input and output for more details.
Sample Input
3
2
3
5
Sample Output
No
No
Yes
0.000000 0.525731
-0.500000 0.162460
-0.309017 -0.425325
0.309017 -0.425325
0.500000 0.162460
以原点为圆心,半径为1的圆内,以原点为顶点,变成为1的正三角形另外两个点在圆上,你会发现,两个点之间的那段弧,上的所有点都是满足条件的,所以只要三个顶点分别是正三角形的三个顶点,其余的点在弧上,都是正确的
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <stdio.h>
using namespace std;
int n;
int t;
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
if(n<=3)
printf("No\n");
else
{
printf("Yes\n");
printf("0.000000 0.000000\n");
printf("0.500000 %.6f\n",-1.0*sqrt(3.0)/2);
printf("-0.500000 %.6f\n",-1.0*sqrt(3.0)/2);
for(int i=1;i<=n-3;i++)
printf("-0.000000 -1.000000\n");
}
}
return 0;
}
FZU 2140 Forever 0.5(找规律,几何)的更多相关文章
- FZU 2140 Forever 0.5
Problem 2140 Forever 0.5 Accept: 36 Submit: 113 Special JudgeTime Limit: 1000 mSec Memory ...
- FZU 2140 Forever 0.5 (几何构造)
Forever 0.5 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- ACM学习历程—FZU 2140 Forever 0.5(计算几何 && 构造)
Description Given an integer N, your task is to judge whether there exist N points in the plane su ...
- FZU 2140 Forever 0.5(将圆离散化)
主要就是将圆离散化,剩下的都好办 #include<iostream> #include<cstdio> #include<cstring> #include< ...
- fzu Problem 2140 Forever 0.5(推理构造)
题目:http://acm.fzu.edu.cn/problem.php?pid=2140 题意: 题目大意:给出n,要求找出n个点,满足: 1)任意两点间的距离不超过1: 2)每个点与(0,0)点的 ...
- 翻翻棋(找规律问题)(FZU Problem 2230)
题目是这样的: FZU Problem 2230 象棋翻翻棋(暗棋)中双方在4*8的格子中交战,有时候最后会只剩下帅和将.根据暗棋的规则,棋子只能上下左右移动,且相同的级别下,主动移动到地方棋子方将吃 ...
- FZU2168——防守阵地 I——————【找规律或前缀和】
防守阵地 I Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- hdu 3951 - Coin Game(找规律)
这道题是有规律的博弈题目,,, 所以我们只需要找出规律来就ok了 牛人用sg函数暴力找规律,菜鸟手工模拟以求规律...[牢骚] if(m>=2) { if(n<=m) {first第一口就 ...
- HDU 5703 Desert 水题 找规律
已知有n个单位的水,问有几种方式把这些水喝完,每天至少喝1个单位的水,而且每天喝的水的单位为整数.看上去挺复杂要跑循环,但其实上,列举几种情况之后就会发现是找规律的题了= =都是2的n-1次方,而且这 ...
随机推荐
- CakePHP不支持path/to路径,前后台无法方法
本来想把前后台分离,可是阅读了cakephp的说明,才发现.cakephp根本就不支持path/to路径. cakephp官网给出的 管理员分离方式:http://book.cakephp.org/2 ...
- spawn-fcgi原理及源代码分析
spawn-fcgi是一个小程序,作用是管理fast-cgi进程,功能和php-fpm类似,简单小巧,原先是属于lighttpd的一部分.后来因为使用比較广泛.所以就迁移出来作为独立项目了.本文介绍的 ...
- mysql 主主复制(双主复制)报错Last_SQL_Errno: 1146
Last_Errno: 1146 Last_Error: Error 'Table 'test.user' doesn't exist' on query. Default database: 'te ...
- CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙
CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48 作者:哎丫丫 来源:哎丫丫数码网 查看:11761 评论:2 ...
- linux命令之fuser
Usage: fuser [ -a | -s | -c ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME... [ - ] [ -n SPACE ] [ -SIGN ...
- windows下安装配置apacheserver
注:一開始公布的时候 图片是复制粘贴的.所以公布完图片所有消失了...如今是补发图片. . .2016/04/25 1.进入apache官网 http://httpd.apache.org/ 这里我 ...
- C#如何调用其他.config配置文件,就是2个乃至3个以上的config文件
XmlDocument xDoc = new XmlDocument(); try { xDoc.Load(配置文件路径); XmlNode xNode; XmlElement xElem; xNod ...
- 5分钟用Spring4 搭建一个REST WebService(转)
章节目录 前置技能 新建项目,配置依赖文件 编写Model和Controller 启动服务&访问 但是 其他 前置技能 ① 使用maven来管理java项目 这个技能必须点一级,以便快速配置项 ...
- RP2836 板卡信息标识
RP2836 板卡信息标识 可以标识16种扩展应用 MCI_DA4 PD5 R120上拉 R121下拉 MCI_DA5 PD6 R125上拉 R124下拉 MCI_DA6 PD7 R122 ...
- TVS二极管的主要参数与选型
TVS二极管的主要参数--转载 处理瞬时脉冲对器件损害的最好办法是将瞬时电流从敏感器件引开.TVS二极管在线路板上与被保护线路并联,当瞬时电压超过电路正常工作电压后,TVS二极管便发生雪崩,提供给瞬时 ...