转载来自:https://blog.csdn.net/queuelovestack/article/details/52667228

Given an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions:

1. The distance between any two points is no greater than 1.0.

2. The distance between any point and the origin (0,0) is no greater than 1.0.

3. There are exactly N pairs of the points that their distance is exactly 1.0.

4. The area of the convex hull constituted by these N points is no less than 0.5.

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

Hint

This problem is special judge.

代码 :

#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=3;i<n;i++)printf("0.000000 1.000000\n"); }}return 0;
}

只能说自己脑子秀逗了这都想不到

Forever 0.5 (计算几何思维)相关推荐

  1. 【FZU - 2140 】Forever 0.5 (计算几何,构造)

    题干: Given an integer N, your task is to judge whether there exist N points in the plane such that sa ...

  2. HDU - 4370 0 or 1(思维+最短路)

    题目链接:点击查看 题目大意:给定一个n*n的矩阵,需要构造出一个n*n的矩阵,规定矩阵只能由0或1组成,使得最小. 题目解析:题意很明确,但是却很抽象,我们需要从图论的角度来看待三个初始条件: 假设 ...

  3. 51Nod 1003 阶乘后面0的数量 | 思维

    题意:n的阶乘后面0的个数,如果直接算出阶乘再数0的数量一定会超时的. 因为10=2*5,所以求出5贡献的次数就行. #include "bits/stdc++.h" using ...

  4. MindNode Pro 5.0.1 MAC思维导图工具最新版

    关注 公众号 Cola叮咚 发送 mind 即可获得下载地址 Mindnode Mac版是Mac平台上的一款Mac思维导图软件,Mindnode Mac版能够让我们快速的创建出美观的思维导图,单击一次 ...

  5. 大数据时代:从1.0到3.0 | 专访清华社会学系教授罗家德

    清华大学社会学系教授.数据科学研究院RONG教授罗家德 记者:能不能请您简要介绍一下您所做的研究项目? 罗家德:分享一下有关于针对社会.商业.营销大数据而有的社会计算(social computing ...

  6. 2005年博客与web2.0十大最拽的武侠人物

    2005年,网络江湖被博客和web2.0炒得沸沸扬扬高潮迭起.在乱世当中,谁是武林中的主角?西门吹草今天就胡扯几段,评出2005年博客与web2.0十大最拽的武侠人物.究竟这些人是英雄还是小人,是善还 ...

  7. 从大学生到职场人,一段深刻的思维认知升级补丁

    时光飞逝,现在已是21世纪20年代了,这些年,火哥也听过读过不少资深人士的职场经历分享.这些分享里面充斥着各种各样的价值观,有说工作前几年要多学东西,提升自己,不要在乎工资的;有说哪里钱多去哪的;有以 ...

  8. markdown 行内公式_如何轻松将笔记转为思维导图(Word、Markdown)

    目录 简介 Markdown -> XMind Word -> XMind 简介 思维导图是一种一种图像式思维的工具,便于我们理解知识之间的逻辑关系. 在我们的学习.生活中,我们习惯于使用 ...

  9. 【干货收藏】数据分析师必备的20种分析思维

    作为新手数据分析师或数据运营,在面对数据异常的时候,好多小伙伴都会出现: " 好像是A引起的 " ," 好像也和B渠道有关 "," 也可能是竞争对手C ...

  10. 如何将计算思维融合到C语言程序设计中,利用案例融合计算思维与C语言教学

    摘 要: C语言程序设计的教学目标是使学生利用C语言结合算法解决简单的实际问题.要实现该目标不仅要熟练掌握C语言本身的基本语法和结构,还要具备设计合理算法的思维能力.然而,当前各高校课程教学往往忽略思 ...

最新文章

  1. Web系统中Mic设备的应用实例
  2. linux c 获取进程 cpu占用率 内存占用情况
  3. 中科大计算机学院的保研率,中科大2021届保研率44.7%,少年班83.4%,物理计算机人数最多...
  4. 一步一步识别验证码(切分和识别)
  5. spring boot编写并运行HelloWorld服务接口
  6. android 点击跳过,android开发里跳过的坑——button不响应点击事件
  7. python 死循环程序能占满cpu吗_运行tensorflow python程序,限制对GPU和CPU的占用操作...
  8. C语言算术运算符介绍和示例
  9. C#图解教程读书笔记(结构)
  10. 2022-01-12总结 CSS开篇
  11. C#音视频处理开源项目收录
  12. 人月神话贯彻执行_《人月神话》读后感与读书笔记
  13. arts-week12
  14. Redis高并发1-redis环境搭建
  15. 英语对混职场有用么?
  16. 软件配置管理(SCM)介绍
  17. 永磁同步电机dq坐标系中转矩公式中系数3/2的由来
  18. 计算机应用的最广领域,从乡镇企业的从业人员数,我们可以看出:
  19. Java实现按分数排名,同分同名次
  20. 又一次算法作业hhhhhh

热门文章

  1. 春暖花开php,春暖花开的朋友圈说说 开心的说说短句
  2. java多线程 信号量(Semaphore),死锁
  3. 支持多浏览器高拍仪开发控件
  4. chaos-monkey-spring-boot小试牛刀
  5. 高级网络配置+Ipv6
  6. 弎问笔录30 之 狐狸和兔子(二)
  7. 2013第44周日小结
  8. 第1讲:软件测试背景
  9. 【跃迁之路】【507天】程序员高效学习方法论探索系列(实验阶段264-2018.06.27)...
  10. Netflix是如何针对云构建和部署代码的