Cody

Solution 231891

Submitted on 17 Apr 2013
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
p = 10; [Nopt,prod] = max_product(p); assert(isequal(Nopt,4)) assert(abs(prod - 39.0625)<1e-4)

Error using max_product Too many output arguments. Error in TestPoint1 (line 2) [Nopt,prod] = max_product(p);

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

Error using max_product Too many output arguments. Error in TestPoint2 (line 2) [Nopt,prod] = max_product(p);

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

Error using max_product Too many output arguments. Error in TestPoint3 (line 2) [Nopt,prod] = max_product(p);

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

Error using max_product Too many output arguments. Error in TestPoint4 (line 2) [Nopt,prod] = max_product(p);

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

Error using max_product Too many output arguments. Error in TestPoint5 (line 2) [Nopt,prod] = max_product(p);