eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Chess Tableaux

Chess Tableaux

Consider some partition of an integer number \textbf{n = m_1 + m_2 + ... + m_k} where \textbf{m_1} ≥ \textbf{m_2} ≥ ... ≥ \textbf{m_k}. This partition may be illustrated by the \textit{Young diagram} - \textbf{n} boxes arranged in \textbf{k} rows, where \textbf{k} is the number of terms in the partition. A row representing the number \textbf{m_i} contains \textbf{m_i} boxes. All rows are left-aligned, and sorted from longest to shortest. \includegraphics{https://static.e-olymp.com/content/5d/5d6f5be71a938a2e11418a493e181e870ad24e95.jpg} Young diagram can be converted to \textit{Young tableau} by putting integer numbers from \textbf{1} to \textbf{n} to boxes, in such a way that the numbers in each row and each column increase from left to right, and from top to bottom, respectively. \includegraphics{https://static.e-olymp.com/content/78/7880c8245d431555053385be2350c66711f19044.jpg} The Young tableau is called a \textit{chess tableau} is after coloring its boxes as on a chessboard (top left box colored black), black boxes contain odd numbers, and white boxes contain even numbers. \includegraphics{https://static.e-olymp.com/content/9a/9a36d3b11e0e3f89dd338763b748b64c4119eda1.jpg} Clearly, not every Young diagram can be converted to a chess tableau. For example, none of the two diagrams below can be converted to a chess tableau. \includegraphics{https://static.e-olymp.com/content/cd/cd72e3da4e865d88a3b52d22a9cf157843f4c8e5.jpg} Given \textbf{n}, find the number of partitions of \textbf{n} such that the corresponding Young diagram can be coverted to a chess tableau. \InputFile Input file contains \textbf{n} (\textbf{1} ≤ n ≤ \textbf{50}). \OutputFile Output one integer number - the number of partitions of \textbf{n} for which there is a chess tableau.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
10
Вихідні дані #1
36