Back
Close

Folding Paper to Reach Heights ...

Statement

 Goal

If you perfectly fold a paper in half, you will double its thickness.

Your code must output the minimum no. of folds that is required to reach the given distance or height.

(Note: The thickness of the paper T will be given in Millimeters and the input distance or height D will be given in Kilometers.)
Input
Line 1: A floating point number T for the thickness of paper (in Millimeters).
Line 2: A floating point number D for the distance or height (in Kilometers).
Output
An integer, representing the minimum no. of folds that is required to reach the given distance or height.
Constraints
0 ≤ T < 0.5
0 ≤ D < 10000000000.0
Example
Input
0.100
1.0
Output
24

Game modes
Fastest, Shortest

Test cases
Example Test
Input
0.100 1.0
Output
24

Validator 1 Validator
Input
0.109 4.0
Output
26

Top of Mt.Everest Test
Input
0.107 8.9
Output
27

Validator 2 Validator
Input
0.106 20.0
Output
28

To reach the ISS Test
Input
0.110 408.0
Output
32

Validator 3 Validator
Input
0.123 300.0
Output
32

To reach the Moon Test
Input
0.121 384400.0
Output
42

Validator 4 Validator
Input
0.124 600000.0
Output
43

To reach the Sun Test
Input
0.107 149597870.0
Output
51

Validator 5 Validator
Input
0.132 999999999.0
Output
53

Out of the Solar System Test
Input
0.112 6000000000.0
Output
56

Validator 6 Validator
Input
0.115 3000000000.0
Output
55

Solution language

Solution

Stub generator input