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
Problem Comments
-
2 Comments
Dyuman Joshi
on 18 Sep 2025 at 16:24
Sssssshhhh! Don't spoil it!!!
Matthew
on 18 Sep 2025 at 18:17
;)
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
8 Solvers
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!