CF830D.Singer House

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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

Singer 44 -houseCount the number of non-empty paths in Singer kk -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 109+710^{9}+7 .

输入格式

The only line contains single integer kk ( 1<=k<=4001<=k<=400 ).

输出格式

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

输入输出样例

  • 输入#1

    2
    

    输出#1

    9
    
  • 输入#2

    3
    

    输出#2

    245
    
  • 输入#3

    20
    

    输出#3

    550384565
    

说明/提示

There are 99 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.

Singer 22 -house

首页