Cody

# Problem 42698. Why the heck are they blinking!?!?

Solution 801105

Submitted on 5 Jan 2016 by Zikobrelli
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)

L = 3.3830 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)

L = 63.1273 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)

L = 943.0867 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 L = 314.5837 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 = 9 L = 198.2439 LOL = 198.2439 test = 3.4679e-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)

L = 113.8883 w = 10 L = 125.9179 n = 11 L = 345.9679 LOL = 345.9679 test = 3.8959e-05