Description

The Department of economic development of IT City created a model of city development till year 2100.

To prepare report about growth perspectives it is required to get growth estimates from the model.

To get the growth estimates it is required to solve a quadratic equation. Since the Department of economic development of IT City creates realistic models only, that quadratic equation has a solution, moreover there are exactly two different real roots.

The greater of these roots corresponds to the optimistic scenario, the smaller one corresponds to the pessimistic one. Help to get these estimates, first the optimistic, then the pessimistic one.

Input

The only line of the input contains three integers a, b, c ( - 1000 ≤ a, b, c ≤ 1000) — the coefficients of ax2 + bx + c = 0 equation.

Output

In the first line output the greater of the equation roots, in the second line output the smaller one. Absolute or relative error should not be greater than 10 - 6.

Examples
input
1 30 200
output
-10.000000000000000
-20.000000000000000
简单求解
其实注意一下a=0 然而测试数据并没有
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
double v[2];
int main()
{
double a,b,c,x1,x2,delta;
cin>>a>>b>>c;
if (a!=0)
{
delta=b*b-4*a*c;
if (delta>=1e-9)
{
v[0]=(-b+sqrt(delta))/(2*a);
v[1]=(-b-sqrt(delta))/(2*a);
sort(v,v+2);
printf("%.10f %.10f",v[1],v[0]);
}
}
else
{
printf("%.10f %.10f",c/b,c/b);
}
return 0;
}

  

Experimental Educational Round: VolBIT Formulas Blitz N的更多相关文章

  1. Experimental Educational Round: VolBIT Formulas Blitz

    cf的一次数学场... 递推 C 题意:长度<=n的数只含有7或8的个数 分析:每一位都有2种可能,累加不同长度的方案数就是总方案数 组合 G 题意:将5个苹果和3个梨放进n个不同的盒子里的方案 ...

  2. Experimental Educational Round: VolBIT Formulas Blitz K

    Description IT City company developing computer games decided to upgrade its way to reward its emplo ...

  3. Experimental Educational Round: VolBIT Formulas Blitz J

    Description IT City company developing computer games invented a new way to reward its employees. Af ...

  4. Experimental Educational Round: VolBIT Formulas Blitz F

    Description One company of IT City decided to create a group of innovative developments consisting f ...

  5. Experimental Educational Round: VolBIT Formulas Blitz D

    Description After a probationary period in the game development company of IT City Petya was include ...

  6. Experimental Educational Round: VolBIT Formulas Blitz C

    Description The numbers of all offices in the new building of the Tax Office of IT City will have lu ...

  7. Experimental Educational Round: VolBIT Formulas Blitz B

    Description The city administration of IT City decided to fix up a symbol of scientific and technica ...

  8. Experimental Educational Round: VolBIT Formulas Blitz A

    Description The HR manager was disappointed again. The last applicant failed the interview the same ...

  9. Experimental Educational Round: VolBIT Formulas Blitz K. Indivisibility —— 容斥原理

    题目链接:http://codeforces.com/contest/630/problem/K K. Indivisibility time limit per test 0.5 seconds m ...

随机推荐

  1. Eclipse 快键键(持续更新)

    本人抛弃一些简单常见的快键键,例如 ctrl+c   ,+v ,+z之类的 1.ctrl+d 删除一整行 2.ctrl+f 搜索 3.光标选中几行,ctrl+alt+↓ 向下复制选中的那几行 4.光标 ...

  2. JS/jQuery--iframe框架内外元素的操作(转)

    JS/jQuery--iframe框架内外元素的操作 原创 2017年12月07日 14:23:09 标签: js / iframe 28 两个问题: 如何在父页面操作iframe框架内的元素? 如何 ...

  3. eclipse格式化代码模板

    <?xml version="1.0" encoding="UTF-8" standalone="no"?> <profi ...

  4. JDBC MySQL 实例之 用户管理系统

    1 Java 和 MySQL 怎么建立连接 2 通过Java怎么对数据库进行操作 package day01; import java.sql.Connection; import java.sql. ...

  5. VS2013中,将Qt的GUI程序改为控制台程序

    在Visual studio 中创建QT GUI程序是不带Console的,但是调试时候常常需要查看打印信息,可以通过如下设置显示控制台 方法一.在vs中直接创建控制台程序方法二.当你通过设置你的应用 ...

  6. Ubuntu 添加用户到sudoers

    ubuntu上的用户有时候需要用到管理员权限,可以通过修改 /etc/sudoers 文件内容添加用户权限. 操作方式 1. 首先以root进入系统打开文件 sudo vim /etc/sudoers ...

  7. HTML中关于url、scr、href的区别

    URL是什么 URL:Uniform Resource Locators(统一资源定位器)的简写,Web浏览器通过URL从Web服务器请求页面. url不是属性,src和href是属性,src用于替换 ...

  8. C++笔记--名字空间和异常

    名字空间 成员函数可以在名字空间的定义里去声明,然后再去采用一种定义方式例如:namespace__name::member_name的方式去定义这个成员函数 namespace parser{ do ...

  9. Spring-访问静态资源文件的方法

    转自:  http://blog.163.com/zhangmihuo_2007/blog/static/27011075201453044959574?suggestedreading 如果你的Di ...

  10. 关于redis-windows环境下的一些配置:

    如果报错: The Windows version of Redis allocates a memory mapped heap for sharing with the forked proces ...