Cody

# Problem 3061. Mirror, mirror on the wall, who is fairest of them all?

Solution 593506

Submitted on 8 Mar 2015 by rifat
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
%% A=[2 1 1 1 1;0 2 1 1 1;0 0 2 1 1;0 0 0 2 1;0 0 0 0 2]; assert(isequal(fairest_girl(A),1064));

2   Pass
%% A=[2 1;0 2]; assert(isequal(fairest_girl(A),1016));

3   Pass
%% assert(isequal(fairest_girl([2 1 0.5;0 2 0.5;0.5 0.5 2]),1016));

4   Pass
%% A=[2 1 1 1 1 1;0 2 1 1 1 1;0 0 2 1 1 1;0 0 0 2 0.5 0.5;0 0 0 0.5 2 0.5;0 0 0 0.5 0.5 2]; assert(isequal(fairest_girl(A),1080));

5   Pass
%% A=[2 0.5 1;0.5 2 0.5;0 0.5 2]; assert(isequal(fairest_girl(A),1016));

6   Pass
%% A=[2 1 1 1 1 1 1;0 2 1 1 1 1 1;0 0 2 1 1 1 1;0 0 0 2 0.5 0.5 1;0 0 0 0.5 2 0.5 1;0 0 0 0.5 0.5 2 1;0 0 0 0 0 0 2]; assert(isequal(fairest_girl(A),1096));

7   Pass
%% A=[2 1 1 1 1 1 0.5;0 2 1 1 1 1 0.5;0 0 2 1 1 1 0.5;0 0 0 2 0.5 0.5 0.5;0 0 0 0.5 2 0.5 0.5;0 0 0 0.5 0.5 2 0.5;0.5 0.5 0.5 0.5 0.5 0.5 2]; assert(isequal(fairest_girl(A),1080));