codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

630N.md (1311B)


      1 Source: https://codeforces.com/problemset/problem/630/N
      2 
      3 N. Forecast
      4 
      5 time limit per test
      6 
      7 0.5 seconds
      8 
      9 memory limit per test
     10 
     11 64 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 The Department of economic development of IT City created a model of city development till year 2100.
     22 
     23 To prepare report about growth perspectives it is required to get growth estimates from the model.
     24 
     25 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.
     26 
     27 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.
     28 
     29 Input
     30 
     31 The only line of the input contains three integers *a*, *b*, *c* ( - 1000 ≤ *a*, *b*, *c* ≤ 1000) — the coefficients of *ax*2 + *bx* + *c* = 0 equation.
     32 
     33 Output
     34 
     35 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.
     36 
     37 Examples
     38 
     39 Input
     40 
     41 ```
     42 1 30 200
     43 ```
     44 
     45 Output
     46 
     47 ```
     48 -10.000000000000000  
     49 -20.000000000000000
     50 ```