Cody

Solution 2653874

Submitted on 5 Jul 2020 by Nikolaos Nikolaou
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
P=14; A=12; y=wrecked_angles(P,A); y_correct = 20.63495408493621; junk=abs(y-y_correct); assert(junk-1<1e-10);

y = 19.634954084936208

2   Pass
P=34; A=60; y=wrecked_angles(P,A); y_correct = 131.7322896141688; junk=abs(y-y_correct); assert(junk-1<1e-10);

y = 1.327322896141688e+02

3   Pass
P=62; A=168; y=wrecked_angles(P,A); y_correct = 590.8738521234052; junk=abs(y-y_correct); assert(junk-100<1e-10);

y = 4.908738521234052e+02

4   Pass
s1=100; totalsum=zeros(1,s1); for s2=1:s1 P=2*(s1+s2); A=s1*s2; totalsum(s2)=wrecked_angles(P,A); end s=sum(totalsum); s_correct=1051137.631982975; s_junk=abs(s-s_correct); assert(s_junk<1e-8); d=max(totalsum)-min(totalsum); d_correct=7853.196235811095; d_junk=abs(d-d_correct); assert(d_junk<1e-8);

y = 7.854767032137880e+03 y = 7.857123226628071e+03 y = 7.861050217445058e+03 y = 7.866548004588842e+03 y = 7.873616588059419e+03 y = 7.882255967856792e+03 y = 7.892466143980959e+03 y = 7.904247116431921e+03 y = 7.917598885209676e+03 y = 7.932521450314228e+03 y = 7.949014811745574e+03 y = 7.967078969503716e+03 y = 7.986713923588650e+03 y = 8.007919674000383e+03 y = 8.030696220738909e+03 y = 8.055043563804231e+03 y = 8.080961703196345e+03 y = 8.108450638915256e+03 y = 8.137510370960963e+03 y = 8.168140899333462e+03 y = 8.200342224032758e+03 y = 8.234114345058848e+03 y = 8.269457262411734e+03 y = 8.306370976091413e+03 y = 8.344855486097887e+03 y = 8.384910792431156e+03 y = 8.426536895091223e+03 y = 8.469733794078084e+03 y = 8.514501489391736e+03 y = 8.560839981032184e+03 y = 8.608749268999431e+03 y = 8.658229353293471e+03 y = 8.709280233914304e+03 y = 8.761901910861932e+03 y = 8.816094384136357e+03 y = 8.871857653737577e+03 y = 8.929191719665590e+03 y = 8.988096581920399e+03 y = 9.048572240501999e+03 y = 9.110618695410400e+03 y = 9.174235946645593e+03 y = 9.239423994207582e+03 y = 9.306182838096365e+03 y = 9.374512478311943e+03 y = 9.444412914854314e+03 y = 9.515884147723484e+03 y = 9.588926176919447e+03 y = 9.663539002442203e+03 y = 9.739722624291757e+03 y = 9.817477042468103e+03 y = 9.896802256971247e+03 y = 9.977698267801185e+03 y = 1.006016507495791e+04 y = 1.014420267844144e+04 y = 1.022981107825176e+04 y = 1.031699027438888e+04 y = 1.040574026685279e+04 y = 1.049606105564350e+04 y = 1.058795264076100e+04 y = 1.068141502220530e+04 y = 1.077644819997638e+04 y = 1.087305217407428e+04 y = 1.097122694449896e+04 y = 1.107097251125043e+04 y = 1.117228887432870e+04 y = 1.127517603373377e+04 y = 1.137963398946563e+04 y = 1.148566274152428e+04 y = 1.159326228990973e+04 y = 1.170243263462198e+04 y = 1.181317377566102e+04 y = 1.192548571302685e+04 y = 1.203936844671949e+04 y = 1.215482197673891e+04 y = 1.227184630308513e+04 y = 1.239044142575814e+04 y = 1.251060734475795e+04 y = 1.263234406008456e+04 y = 1.275565157173796e+04 y = 1.288052987971815e+04 y = 1.300697898402515e+04 y = 1.313499888465893e+04 y = 1.326458958161950e+04 y = 1.339575107490688e+04 y = 1.352848336452105e+04 y = 1.366278645046201e+04 y = 1.379866033272977e+04 y = 1.393610501132432e+04 y = 1.407512048624567e+04 y = 1.421570675749382e+04 y = 1.435786382506875e+04 y = 1.450159168897049e+04 y = 1.464689034919901e+04 y = 1.479375980575434e+04 y = 1.494220005863646e+04 y = 1.509221110784537e+04 y = 1.524379295338107e+04 y = 1.539694559524358e+04 y = 1.555166903343287e+04 y = 1.570796326794898e+04

5   Pass
s1=wrecked_angles(32,64); s2=wrecked_angles(72,288); P=2*(s1+s2); A=s1*s2; y=wrecked_angles(P,A); y_correct=259088.4479405854; junk=abs(y-y_correct); assert(junk<1e-10);

y = 1.005309649148734e+02 y = 5.654866776461629e+02 y = 2.590884479405853e+05