| acmsguru |
|---|
| Закончено |
Andrew has just made a breakthrough in puzzle making: he's invented a new puzzle that is both simple to understand and unlike everything that has been invented before. His new puzzle looks like an octahedron with each of its (triangular) faces split into n2 smaller triangles by 3(n-1) lines, n-1 parallel to each side of the face. Some of smaller triangles are black and some are white. The objective is to cover all white triangles with triangular dominoes without overlapping, leaving all black triangles uncovered. A triangular domino is two small triangles with one common side. Please note that a domino can cover one small triangle on a side of the octahedron and another on the adjacent side of the octahedron (in other words, you can bend your domino in the middle). You must place each domino so that it covers exactly two white small triangles (that means you can't cover some part of a triangle with one domino and the rest with another domino, for example). How many solutions does the given puzzle have? .', denoting a white triangle, or by '
*', denoting a black triangle.
sample input | sample output |
2 .*** ........*... ************ .... | 2 |
sample input | sample output |
3 .... ************ .................... ******************** ............ **** | 8 |
| Название |
|---|


