Codeforces Round 424 (Div. 1, rated, based on VK Cup Finals)
D
Singer House
Codeforces
2800
原题
← CE →
翻译中…

It is known that passages in Singer house are complex and intertwined. Let's define a Singer $*k*$-house as a graph built by the following process: take complete binary tree of height $*k*$ and add edges from each vertex to all its successors, if they are not yet present.

翻译中…

image Singer $4$-house

翻译中…

Count the number of non-empty paths in Singer $*k*$-house which do not pass the same vertex twice. Two paths are distinct if the sets or the orders of visited vertices are different. Since the answer can be large, output it modulo $10^{9} + 7$.

翻译中…

Input

翻译中…

The only line contains single integer $*k*$ ($1 ≤ *k* ≤ 400$).

翻译中…

Output

翻译中…

Print single integer — the answer for the task modulo $10^{9} + 7$.

翻译中…

Note

翻译中…

There are $9$ paths in the first example (the vertices are numbered on the picture below): 1, 2, 3, 1-2, 2-1, 1-3, 3-1, 2-1-3, 3-1-2.

翻译中…

image Singer $2$-house

翻译中…

样例

Input #1
2
Output #1
9
InputCopy OutputCopy
Input #2
3
Output #2
245
InputCopy OutputCopy
Input #3
20
Output #3
550384565
InputCopy OutputCopy
题目信息
题号
830D
时间限制
2 s
内存限制
512 MB
标签
组合数学
动态规划
图论
树

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。