Cody

Solution 800660

Submitted on 4 Jan 2016 by Jan Orwat
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=1;n=1; LOL=Length_of_Lights(w,n) test=abs(LOL-3.3830) assert(test<=0.001)

LOL = 3.3833 test = 2.9327e-04

2   Pass
%% w=4;n=5; LOL=Length_of_Lights(w,n) test=abs(LOL-63.1273) assert(test<=0.001)

LOL = 63.1273 test = 6.7330e-06

3   Pass
%% w=20;n=15; LOL=Length_of_Lights(w,n) test=abs(LOL-943.086) assert(test<=0.01)

LOL = 943.0868 test = 7.7978e-04

4   Pass
%% r=[31.4584 62.9167 94.3751 125.8335 157.2919 188.7502 220.2086 251.6670 283.1253 314.5837]; k=ceil(10*rand) LOL=Length_of_Lights(k,10) test=abs(LOL-r(k)) assert(test<=0.001)

k = 3 LOL = 94.3751 test = 1.6266e-05

5   Pass
%% r=[23.6813 45.0198 66.7403 88.5798 110.4727 132.3946 154.3341 176.2850 198.2439 220.2086]; k=ceil(10*rand) LOL=Length_of_Lights(7,k) test=abs(LOL-r(k)) assert(test<=0.001)

k = 2 LOL = 45.0200 test = 1.9975e-04

6   Pass
%% w = floor(sqrt(Length_of_Lights(9,4))) n=floor(sqrt(Length_of_Lights(5,8))) LOL=Length_of_Lights(w,n) test=abs(LOL-345.9679) assert(test<=0.01)

w = 10 n = 11 LOL = 345.9680 test = 5.7728e-05