The conic sections are the nondegenerate curves generated by the intersections of a plane with one or two nappes of a cone. For a plane perpendicular to the axis of the cone, a circle is produced. For a plane that is not perpendicular to the axis and that intersects only a single nappe, the curve produced is either an ellipse or a parabola. The curve produced by a plane intersecting both nappes is a hyperbola.

conic section equation
circle x2+y2=a2
ellipse x2/a2+y2/b2=1
parabola y2=4ax
hyperbola x2/a2-y2/b2=1

Input

There are multiple test cases. The first line of input is an integer T ≈ 10000 indicating the number of test cases.

Each test case consists of a line containing 6 real numbers abcdef. The absolute value of any number never exceeds 10000. It's guaranteed that a2+c2>0b=0, the conic section exists and it is non-degenerate.

Output

For each test case, output the type of conic section ax2+bxy+cy2+dx+ey+f=0. See sample for more details.

Sample Input

5
1 0 1 0 0 -1
1 0 2 0 0 -1
0 0 1 1 0 0
1 0 -1 0 0 1
2 0 2 4 4 0

Sample Output

circle
ellipse
parabola
hyperbola
circle

References

#include <iostream>
#include<cstdio>
using namespace std;
double a,b,c,d,e,f;
int t;
int main()
{
scanf("%d",&t); //开始写成while(~scanf("%d",&t)),tle了
for(;t>;t--)
{
scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f); //题目没读清楚,题目说是实数,我用了%d,就wa了好几次
if (a==c) printf("circle\n"); else //判断是什么形状取决于a和c的关系。
if (a!=c && a*c>) printf("ellipse\n"); else
if (a== || c==) printf("parabola\n"); else
if (a*c<) printf("hyperbola\n");
}
return ;
}

ZOJ 3488 Conic Section的更多相关文章

  1. ZOJ 3430 Detect the Virus

    传送门: Detect the Virus                                                                                ...

  2. 【转载】图论 500题——主要为hdu/poj/zoj

    转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...

  3. ZOJ 4114 Detect the Virus(AC自动机)

    Detect the Virus Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita found that his co ...

  4. POJ 1502 MPI Maelstrom / UVA 432 MPI Maelstrom / SCU 1068 MPI Maelstrom / UVALive 5398 MPI Maelstrom /ZOJ 1291 MPI Maelstrom (最短路径)

    POJ 1502 MPI Maelstrom / UVA 432 MPI Maelstrom / SCU 1068 MPI Maelstrom / UVALive 5398 MPI Maelstrom ...

  5. ZOJ - 3430 Detect the Virus —— AC自动机、解码

    题目链接:https://vjudge.net/problem/ZOJ-3430 Detect the Virus Time Limit: 2 Seconds      Memory Limit: 6 ...

  6. Detect the Virus ZOJ - 3430 AC自动机

    One day, Nobita found that his computer is extremely slow. After several hours' work, he finally fou ...

  7. keil MDK error: L6236E: No section matches selector - no section 错误

    今天板子刚到,新建的第一个工程就报错了. .\Objects\cse.sct(7): error: L6236E: No section matches selector - no section t ...

  8. 【代码笔记】iOS-一个tableView,两个section

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...

  9. gcc/linux内核中likely、unlikely和__attribute__(section(""))属性

    查看linux内核源码,你会发现有很多if (likely(""))...及if (unlikely(""))...语句,这些语句其实是编译器的一种优化方式,具 ...

随机推荐

  1. Hibernate缓存原理

    对于Hibernate这类ORM而言,缓存显的尤为重要,它是持久层性能提升的关键. 简单来讲Hibernate就是对JDBC进行封装,以实现内部状态的管理,OR关系的映射等, 但随之带来的就是数据访问 ...

  2. Hbase 学习笔记4----原理

    MapReduce 中如何处理HBase中的数据?如何读取HBase数据给Map?如何将结果存储到HBase中? Mapper类:包括一个内部类(Context)和四个方法(setup,map,cle ...

  3. change the color of a disabled TEdit?

    change the color of a disabled TEdit? Author: P. Below Category: VCL {Question:How can I change the  ...

  4. r.js的build.js的详细配置解析

    { baseUrl: "../src",//当前文件的父目录的兄弟src目录,意思是这个目录会被完全复制到dir目录下面 mainConfigFile: '../src/init- ...

  5. Loadrunder场景设计篇——定时器(schedule)

    A.   定义方案schedule 在 Scenario Schedule面板中,选择一个方案schedule,或通过点击New Schedule定义一个新的方案 定义schedule: a.新建sc ...

  6. Oracle---------coalesce的用法介绍

    COALESCE (expression_1, expression_2, ...,expression_n)依次参考各参数表达式,遇到非null值即停止并返回该值.如果所有的表达式都是空值,最终将返 ...

  7. HTTP与服务器的四种交互方式

    Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE.URL全称是资源描述符,我们可以这样认为:一个URL地址,它用于描述一个网络上的资源,而HTTP ...

  8. 2018-2019-2 20165114《网络对抗技术》Exp2 后门原理与实践

    目录 一.实验准备 二.实验内容 三.基础问题回答 四.实验过程及步骤 五.实验总结与体会 六.实验中遇到的问题与错误. 一.实验准备 1.后门概念 后门就是不经过正常认证流程而访问系统的通道. 哪里 ...

  9. 20145109《Java程序设计》第二周学习总结

    20145109 <Java程序设计>第二周学习总结 教材学习内容总结 Variable : naming rule : Camel case no default value e.g : ...

  10. 将CString写入到本地文件中

    void SocketU::WritePacket2File(CString packet_str)//packet_str为待写入的字符串{ CTime time = CTime::GetCurre ...