Cody

# Problem 162. High school cafeteria

Solution 1755885

Submitted on 20 Mar 2019 by Mohan V
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
x = 1; y_correct = x; assert(isequal(coolkids(x),y_correct))

p = 1 q = 1 n = 1

2   Pass
x = 2:4; y_correct = x; assert(isequal(coolkids(x),y_correct))

p = 1 q = 3 m = 2 m = 2 3 n = 4

3   Pass
x = 1:10; y_correct = [2 3 5 7 1 4 6 8 9 10]; assert(isequal(coolkids(x),y_correct))

p = 1 q = 10 n = 1 m = 2 m = 2 3 n = 1 4 m = 2 3 5 n = 1 4 6 m = 2 3 5 7 n = 1 4 6 8 n = 1 4 6 8 9 n = 1 4 6 8 9 10

4   Pass
x = 1:5; y_correct = [2 3 5 1 4]; assert(isequal(coolkids(x),y_correct))

p = 1 q = 5 n = 1 m = 2 m = 2 3 n = 1 4 m = 2 3 5

5   Pass
x = [5 1 3 2 4]; y_correct = [2 3 5 1 4]; assert(isequal(coolkids(x),y_correct))

p = 1 q = 5 n = 1 m = 2 m = 2 3 n = 1 4 m = 2 3 5

6   Pass
x = [136 137]; y_correct = [137 136]; assert(isequal(coolkids(x),y_correct))

p = 1 q = 2 n = 136 m = 137