eolymp
bolt
Try our new interface for solving problems
Problems

Hexagon and Rhombic Dominoes

Hexagon and Rhombic Dominoes

A regular hexagon with side length n is divided into \textbf{6n^2} unit triangles. \includegraphics{https://static.e-olymp.com/content/e0/e08fc5483d0ec42ba2e1e478108d4b256d0c9a37.jpg} Your task is to cover it with \textit{rhombic dominoes} --- pieces composed of two unit triangles sharing a side. \includegraphics{https://static.e-olymp.com/content/ac/acd2a93a80d498ed2591a88fe6a22ef617248f01.jpg} Each domino must be placed in such a way, that it covers exactly two unit triangles. No triangle must be covered with more than one domino. Count the number of ways to do so. For example there are two ways to cover a hexagon with side length \textbf{1}, they are shown on the picture. \includegraphics{https://static.e-olymp.com/content/e2/e2036f30ca2271e29f2e6f62773ae9d4e7f8be9d.jpg} \InputFile Input file contains \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{7}). \OutputFile Output the number of ways to cover hexagon with rombic dominoes.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
Output example #1
20
Source 2004 Petrozavodsk, Summer, Andrew Stankevich Contest 7, August 22, Problem D