Cody

# Problem 1174. Wheat on a chessboard pt 2

Solution 3240658

Submitted on 16 Oct 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   Pass
x = 56; y = 1; n = 1; A_correct = 56; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 56

2   Fail
x = 1; y = 2; n = 8; A_correct = 18446744073709551615; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 127

Assertion failed.

3   Fail
x = -1; y = 2; n = 8; A_correct = -18446744073709551615; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 125

Assertion failed.

4   Fail
x = 5; y = 3; n = 2; A_correct = 200; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 14

Assertion failed.

5   Fail
x = 10; y = -5; n = 3; A_correct = 3255210; assert(isequal(wheat_chess(x,y,n),A_correct))

A = -30

Assertion failed.

6   Pass
x = 1; y = 0; n = 1; A_correct = 1; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 1

7   Fail
x = 1; y = 0; n = -1; A_correct = 'NaN'; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 1

Assertion failed.

8   Fail
x = 12; y = 1; n = 3; A_correct = 108; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 20

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!