Cody

Solution 1721211

Submitted on 5 Feb 2019 by Mu
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.3830 test = 4.4286e-05

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 = 1.7871e-05

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

LOL = 943.0867 test = 7.3228e-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 = 10 LOL = 314.5837 test = 3.0240e-06

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.0198 test = 2.2218e-05

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.9679 test = 3.8959e-05

Suggested Problems

More from this Author80