Cody

# Problem 42514. The Hills Are Alive...

Solution 884643

Submitted on 1 May 2016
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
height=300;daily_growth=300;climb=100; assert(isequal(hills_are_alive(height,daily_growth,climb),11))

Assertion failed.

2   Fail
height=200;daily_growth=100;climb=50; assert(isequal(hills_are_alive(height,daily_growth,climb),10))

Assertion failed.

3   Fail
height=150;daily_growth=150;climb=30; assert(isequal(hills_are_alive(height,daily_growth,climb),83))

Assertion failed.

4   Fail
height=200;daily_growth=100;climb=10; assert(isequal(hills_are_alive(height,daily_growth,climb),33616))

Assertion failed.

5   Fail
height=300;daily_growth=200;climb=10; assert(isequal(hills_are_alive(height,daily_growth,climb),503195828))

Assertion failed.

6   Fail
height=1000;daily_growth=500;climb=40; assert(isequal(hills_are_alive(height,daily_growth,climb),409537))

Assertion failed.

7   Fail
height=500;daily_growth=500;climb=25; assert(isequal(hills_are_alive(height,daily_growth,climb),272400600))

Assertion failed.

8   Fail
j=arrayfun(@(climb) hills_are_alive(500,500,climb),10:10:100); assert(isequal(j,[2911002088526880200000 40427833596 9717617 150661 12367 2336 710 291 145 83]))

Assertion failed.

9   Fail
height=500;daily_growth=500;climb=500; assert(isequal(hills_are_alive(height,daily_growth,climb),1))

Assertion failed.

10   Fail
k=arrayfun(@(x) hills_are_alive(x,x/2,100),100:100:1000); assert(isequal(k,[1 3 6 10 18 30 50 82 136 226]))

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!