mail@pastecode.io avatar
10 days ago
897 B
You are given 28 different types of domino, each domino has size of 1x2 with 2 numbers on it as follow

And a board of size 7x8, your task is cover the board with above dominos such that a domino can only be placed on two adjacent squares on board if the numbers of the squares and of domino are equal.

How many different way to cover the board?

For example if the board are given as below, there are 18 way to cover it, one of them is as below.


The first line is the number of test case T (T < = 50).

Each test case will be given on 7 lines, each line have 8 numbers separate by a space is the board for the test case. It have a empty line between 2 test cases.


Print each test case on one line, the first is "#x", where x is the test case number, separate by a space and the numbers of different way to cover the board.
Leave a Comment