Cody

# Problem 44387. Birthday cake

Solution 2181966

Submitted on 30 Mar 2020
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
len = 1; wid = 1; d_correct = 0.7071; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test1 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

2   Fail
len = 2; wid = 3; d_correct = 1.8028; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test2 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

3   Fail
len = 3; wid = 8; d_correct = 3.6056; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test3 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

4   Fail
len = 4; wid = 3; d_correct = 2.5000; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test4 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

5   Fail
len = 5; wid = 4; d_correct = 3.2016; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test5 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

6   Fail
len = 5; wid = 6; d_correct = 3.9051; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test6 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

7   Fail
len = 5; wid = 11; d_correct = 5.5200; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test7 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

8   Fail
len = 7; wid = 6; d_correct = 4.6098; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test8 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

9   Fail
len = 8; wid = 7; d_correct = 5.3151; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test9 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

10   Fail
len = 8; wid = 9; d_correct = 6.0208; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test10 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

11   Fail
len = 10; wid = 9; d_correct = 6.7268; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test11 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

12   Fail
len = 11; wid = 10; d_correct = 7.4330; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test12 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

13   Fail
len = 12; wid = 23; d_correct = 12.2018; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test13 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

14   Fail
len = 15; wid = 32; d_correct = 16.1616; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test14 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

15   Fail
len = 16; wid = 32; d_correct = 16.5644; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test15 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

16   Fail
len = 17; wid = 32; d_correct = 17.1902; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test16 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

17   Fail
len = 64; wid = 1; d_correct = 16.0312; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test17 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

18   Fail
len = 36; wid = 36; d_correct = 25.4558; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test18 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

19   Fail
len = 48; wid = 24; d_correct = 24.8466; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test19 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

20   Fail
len = 26; wid = 48; d_correct = 26.1679; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test20 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

21   Fail
len = 100.25; wid = 100.25; d_correct = 70.8875; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test21 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

22   Fail
len = 500; wid = 250; d_correct = 258.8190; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test22 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

23   Fail
len = 500; wid = 1000; d_correct = 517.6381; assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test23 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

24   Fail
len = randi([1,1e4]); wid = len; d_correct = sqrt((len/2)^2+(wid/2)^2); assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)

Unrecognized function or variable 'width'. Error in birthdaycandles (line 3) d = (2*len + 2*width)/5 Error in Test24 (line 3) assert(abs(birthdaycandles(len,wid)-d_correct)<1e-2)