Cody

# Problem 1277. How many days does the cat take to climb out of the hole?

Solution 1214485

Submitted on 17 Jun 2017
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
h = 20; m=5; n=3; y_correct = 9; assert(isequal(catdays(h,m,n),y_correct))

h = 16 ans = 2 h = 14 ans = 3 h = 12 ans = 4 h = 10 ans = 5 h = 8 ans = 6 h = 6 ans = 7 h = 4 ans = 8 h = 2 ans = 9

2   Pass
h = 15; m=6; n=1; y_correct = 3; assert(isequal(catdays(h,m,n),y_correct))

h = 5 ans = 2 h = 0 ans = 3

3   Fail
h = 25; m=6; n=5; y_correct = 21; assert(isequal(catdays(h,m,n),y_correct))

h = 23 ans = 2 h = 22 ans = 3 h = 21 ans = 4 h = 20 ans = 5 h = 19 ans = 6 h = 18 ans = 7 h = 17 ans = 8 h = 16 ans = 9 h = 15 ans = 10 h = 14 ans = 11 h = 13 ans = 12 h = 12 ans = 13 h = 11 ans = 14 h = 10 ans = 15 h = 9 ans = 16 h = 8 ans = 17 h = 7 ans = 18 h = 6 ans = 19 h = 5 ans = 20

Assertion failed.

4   Fail
h = 22; m=6; n=5; y_correct = 18; assert(isequal(catdays(h,m,n),y_correct))

h = 20 ans = 2 h = 19 ans = 3 h = 18 ans = 4 h = 17 ans = 5 h = 16 ans = 6 h = 15 ans = 7 h = 14 ans = 8 h = 13 ans = 9 h = 12 ans = 10 h = 11 ans = 11 h = 10 ans = 12 h = 9 ans = 13 h = 8 ans = 14 h = 7 ans = 15 h = 6 ans = 16 h = 5 ans = 17

Assertion failed.

5   Pass
h = 31; m=8; n=5; y_correct = 9; assert(isequal(catdays(h,m,n),y_correct))

h = 25 ans = 2 h = 22 ans = 3 h = 19 ans = 4 h = 16 ans = 5 h = 13 ans = 6 h = 10 ans = 7 h = 7 ans = 8 h = 4 ans = 9