Cody

Solution 1231858

Submitted on 15 Jul 2017 by Chris Cleveland
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
p = 10; [Nopt,prod] = max_product(p); assert(isequal(Nopt,4)) assert(abs(prod - 39.0625)<1e-4)

2   Pass
p = 29; [Nopt,prod] = max_product(p); assert(isequal(Nopt,11)) assert(abs(prod - 4.276204243443044e+04)<1e-4)

3   Pass
p = 49; [Nopt,prod] = max_product(p); assert(isequal(Nopt,18)) assert(abs(prod - 6.739448339947788e+07)<1e-4)

4   Pass
p = 256; [Nopt,prod] = max_product(p); assert(isequal(Nopt,94)) assert(abs(prod - 7.953137683223010e+40)<1e-4)

5   Pass
p = 1000000; [Nopt,prod] = max_product(p); assert(isequal(Nopt,367879)) assert(isinf(prod))