Submission details
Task:Rain Fall
Sender:z
Submission time:2016-10-04 16:43:31 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.03 sdetails
#30.05 sdetails
#40.02 sdetails
#50.04 sdetails
#60.04 sdetails
#70.03 sdetails
#80.04 sdetails
#90.04 sdetails
#100.06 sdetails
#110.03 sdetails
#120.04 sdetails
#130.04 sdetails
#140.04 sdetails
#150.03 sdetails
#160.03 sdetails
#170.04 sdetails
#180.04 sdetails
#190.05 sdetails
#200.04 sdetails
#210.04 sdetails
#220.04 sdetails
#230.02 sdetails
#240.04 sdetails
#250.02 sdetails
#260.04 sdetails
#270.03 sdetails
#280.04 sdetails
#290.05 sdetails
#300.05 sdetails
#310.05 sdetails
#320.03 sdetails
#330.04 sdetails
#340.03 sdetails
#350.05 sdetails
#360.04 sdetails

Code

#include <iostream>
#include <iomanip>
using namespace std;
long double L, K, T1, T2, H;




long double en(long double h){
  long double b=h;
  if (b>L){
    long double btgl=L/(h/T1);
    b-=K*(T2+T1-btgl);
    if (b<L) b=L;
  }
  cout << b << "\n";
  return b;
}


long double mn(){
  long double a=0;
  long double b=1e10;
  for (int i=0; i<500; ++i){
    long double m=(a+b)/2;
    if (en(m)<H) a=m;
    else b=m;
  }
  return a;
}

long double mx(){
  long double a=0;
  long double b=1e10;
  for (int i=0; i<500; ++i){
    long double m=(a+b)/2;
    if (en(m)>H) b=m;
    else a=m;
  }
  return a;
}


int main(){
  cin >> L >> K >> T1 >> T2 >> H;
  cout << setprecision(20) << mn() << " " << setprecision(20) << mx() << "\n";
  
}

Test details

Test 1

Verdict:

input
80.00 0.50 2.00 1.50 80.00

correct output
80.000000000 80.759403280

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 2

Verdict:

input
100.00 0.50 2.00 1.50 80.00

correct output
80.000000000 80.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 3

Verdict:

input
150.00 1.00 100.00 150.00 100....

correct output
100.000000000 100.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 4

Verdict:

input
150.00 1.00 100.00 150.00 150....

correct output
150.000000000 358.113883008

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 5

Verdict:

input
150.00 1.00 100.00 15.00 415.0...

correct output
500.000000000 500.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 6

Verdict:

input
50.00 5.00 2.00 2.00 40.00

correct output
40.000000000 40.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 7

Verdict:

input
50.00 5.00 2.00 2.00 50.00

correct output
50.000000000 61.925824036

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 8

Verdict:

input
50.00 5.00 2.00 2.00 65.00

correct output
78.642080737 78.642080737

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 9

Verdict:

input
10.00 1.00 3.00 3.00 3.00

correct output
3.000000000 3.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 10

Verdict:

input
10.00 1.00 3.00 3.00 10.00

correct output
10.000000000 13.830951895

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 11

Verdict:

input
10.00 1.00 3.00 3.00 16.00

correct output
20.539392014 20.539392014

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 12

Verdict:

input
10.00 1.00 3.00 3.00 25.00

correct output
30.000000000 30.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 13

Verdict:

input
10.00 1.00 3.00 3.00 33.00

correct output
38.214967272 38.214967272

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 14

Verdict:

input
1.00 2.00 3.00 2.00 5.00

correct output
14.588723439 14.588723439

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 15

Verdict:

input
6.00 2.00 3.00 2.00 7.00

correct output
14.520797289 14.520797289

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 16

Verdict:

input
11.00 2.00 3.00 2.00 11.00

correct output
11.000000000 17.152067348

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 17

Verdict:

input
16.00 2.00 3.00 2.00 15.00

correct output
15.000000000 15.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 18

Verdict:

input
21.00 2.00 3.00 2.00 15.00

correct output
15.000000000 15.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 19

Verdict:

input
26.00 2.00 3.00 2.00 15.00

correct output
15.000000000 15.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 20

Verdict:

input
31.00 2.00 3.00 2.00 15.00

correct output
15.000000000 15.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 21

Verdict:

input
25.00 2.00 1.00 1.00 10.00

correct output
10.000000000 10.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 22

Verdict:

input
25.00 2.00 1.00 2.00 10.00

correct output
10.000000000 10.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 23

Verdict:

input
25.00 2.00 1.00 3.00 10.00

correct output
10.000000000 10.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 24

Verdict:

input
25.00 2.00 2.00 1.00 20.00

correct output
20.000000000 20.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 25

Verdict:

input
25.00 2.00 2.00 2.00 20.00

correct output
20.000000000 20.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 26

Verdict:

input
25.00 2.00 2.00 3.00 20.00

correct output
20.000000000 20.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 27

Verdict:

input
25.00 2.00 3.00 1.00 26.00

correct output
28.789826123 28.789826123

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 28

Verdict:

input
25.00 2.00 3.00 2.00 25.00

correct output
25.000000000 30.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 29

Verdict:

input
25.00 2.00 3.00 3.00 25.00

correct output
25.000000000 32.365424624

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 30

Verdict:

input
25.00 2.00 4.00 1.00 34.00

correct output
38.852299546 38.852299546

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 31

Verdict:

input
25.00 2.00 4.00 2.00 32.00

correct output
38.852299546 38.852299546

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 32

Verdict:

input
25.00 2.00 4.00 3.00 30.00

correct output
38.852299546 38.852299546

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 33

Verdict:

input
25.00 2.00 3.00 2.00 25.00

correct output
25.000000000 30.000000000

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 34

Verdict:

input
25.00 2.00 3.00 3.00 25.00

correct output
25.000000000 32.365424624

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 35

Verdict:

input
5.00 7.00 0.01 2.00 6.00

correct output
20.052545857 20.052545857

user output
5e+09
2.5e+09
1.25e+09
6.25e+08
3.125e+08
...

Test 36

Verdict:

input
0.01 1000.00 1000.00 1000.00 1...

correct output
2000999.995002499 2000999.9950...

user output
4.998e+09
2.498e+09
1.248e+09
6.23e+08
3.105e+08
...