Cody

# Problem 44307. The glass half full

Solution 1305539

Submitted on 20 Oct 2017 by Ashley Goddard
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
[g f t] = filltime(0.25, 0.1, 2); assert(isequal([g f t],[3 3 10]))

t = 0 t = 1 t = 4 t = 10 g = 3 f = 3 t = 10

2   Pass
[g f t] = filltime(0.45, 0.3, 6); assert(isequal([g f t],[21 15 69]))

t = 0 t = 1 t = 4 t = 10 f = 9 t = 19 f = 12 t = 31 f = 15 t = 46 t = 69 g = 21 f = 15 t = 69

3   Pass
[g f t] = filltime(3, 0.8, 7); assert(isequal([g f t],[28 18 240]))

t = 0 t = 1 t = 4 t = 10 f = 9 t = 19 f = 12 t = 31 f = 15 t = 46 f = 18 t = 64 t = 240 g = 28 f = 18 t = 240

4   Pass
[g f t] = filltime(2, 8, 47); assert(isequal([g f t],[1128 138 811]))

t = 0 t = 1 t = 4 t = 10 f = 9 t = 19 f = 12 t = 31 f = 15 t = 46 f = 18 t = 64 f = 21 t = 85 f = 24 t = 109 f = 27 t = 136 f = 30 t = 166 f = 33 t = 199 f = 36 t = 235 f = 39 t = 274 f = 42 t = 316 f = 45 t = 361 f = 48 t = 409 f = 51 t = 460 f = 54 t = 514 f = 57 t = 571 f = 60 t = 631 f = 63 t = 694 f = 66 t = 760 f = 69 t = 829 f = 72 t = 901 f = 75 t = 976 f = 78 t = 1054 f = 81 t = 1135 f = 84 t = 1219 f = 87 t = 1306 f = 90 t = 1396 f = 93 t = 1489 f = 96 t = 1585 f = 99 t = 1684 f = 102 t = 1786 f = 105 t = 1891 f = 108 t = 1999 f = 111 t = 2110 f = 114 t = 2224 f = 117 t = 2341 f = 120 t = 2461 f = 123 t = 2584 f = 126 t = 2710 f = 129 t = 2839 f = 132 t = 2971 f = 135 t = 3106 f = 138 t = 3244 t = 811 g = 1128 f = 138 t = 811