Cody

# Problem 42382. Combined Ages 1 - Symmetric, n = 3

Solution 1614997

Submitted on 23 Aug 2018 by Srishti Saha
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
AB = 43; BC = 55; AC = 66; y = combined_ages(AB,BC,AC); y_correct = [27 16 39]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 16 C = 39 A = 27 y = 27 16 39

2   Pass
AB = 30; BC = 50; AC = 40; y = combined_ages(AB,BC,AC); y_correct = [10 20 30]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 20 C = 30 A = 10 y = 10 20 30

3   Pass
AB = 20; BC = 70; AC = 60; y = combined_ages(AB,BC,AC); y_correct = [5 15 55]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 15 C = 55 A = 5 y = 5 15 55

4   Pass
AB = 34; BC = 84; AC = 56; y = combined_ages(AB,BC,AC); y_correct = [3 31 53]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 31 C = 53 A = 3 y = 3 31 53

5   Pass
y_correct = [2 11 21]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 11 C = 21 A = 2 y = 2 11 21

6   Pass
y_correct = [11 17 21]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 17 C = 21 A = 11 y = 11 17 21

7   Pass
y_correct = [15 35 55]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

B = 35 C = 55 A = 15 y = 15 35 55