Cody

Solution 1958046

Submitted on 3 Oct 2019 by Paul Morant
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
W=200 L=400 CL=3 CW=6 y_correct = 2239; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 200 L = 400 CL = 3 CW = 6 f = function_handle with value: @(x)CL*x+CW.*(sqrt(W.^2+(L-x).^2)) y = 2.2392e+03

2   Pass
W=100 L=200 CL=2 CW=3 y_correct = 623; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 100 L = 200 CL = 2 CW = 3 f = function_handle with value: @(x)CL*x+CW.*(sqrt(W.^2+(L-x).^2)) y = 623.6068

3   Pass
W=48 L=36 CL=3 CW=5 y_correct = 300; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 48 L = 36 CL = 3 CW = 5 f = function_handle with value: @(x)CL*x+CW.*(sqrt(W.^2+(L-x).^2)) y = 300.0000