Cody

Problem 42514. The Hills Are Alive...

Solution 1562889

Submitted on 18 Jun 2018 by J. S. Kowontan
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   Pass
height=300;daily_growth=300;climb=100; assert(isequal(hills_are_alive(height,daily_growth,climb),11))

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

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

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

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

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

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

8   Pass
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]))

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

10   Pass
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]))