Problem 61004. Rooky Towers

You are wandering and as you realise something's off, you find yourself lost in a peculiar place - Over a giant field which is laid in form of a checkered square base - with towering structures around you.
To safeguard yourself, you have to calculate the numbers of ways of a given number (x) of towering structures can be arranged on the filed (n,n) with a restriction -
The grid (n>=x) will be set such that none of these structures are inline with each other in the 4 basic directions, but they could along the diagonal pathways.
%Example
%For a 2x2 (n,n) field -
% 2 (x) towers can be arranged in 2 ways [|| 0; 0 ||] and [0 ||; || 0]
% 1 (x) tower can be arranged in 4 ways [|| 0; 0 0], [0 ||; 0 0], [0 0; || 0 ] and [0 0; 0 ||]
% and 0 (x) towers can be arranged in 1 way [0 0; 0 0]
Note that there is a limit on the tools you can utilize for your calculation.

Solution Stats

72.73% Correct | 27.27% Incorrect
Last Solution submitted on Sep 26, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers8

Suggested Problems

More from this Author40

Problem Tags

Community Treasure Hunt

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

Start Hunting!