Cover In Cage
All submissions for this problem are available.
The evil Lex Luthor has trapped Batman in a cage. He tortures Batman if he cannot give him an answer to his problem, the number of distinct ways to cover a N x N matrix with L-shaped element and 2 x 2 square elements. Batman knows that Lex does not consider two cover distinct if they are a rotation of each other. Since Frank Miller is not here, you have to help Batman escape.
The number of test cases is t.
- Every test case has one line, containing 2 integers, the dimension of the square matrix, n and mod.
- t <= 10
- n <= 19
- t > 1 then n <= 14
- mod is prime
For each test case, print the number of distinct arrangements modulo mod.
Input: 2 1 7 4 13 Output: 0 3 Explanation
All possible cases are
|Time Limit:||10 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions