CF336E.Vasily the Bear and Painting Square

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Vasily the bear has two favorite integers nn and kk and a pencil. Besides, he's got kk jars with different water color paints. All jars are numbered in some manner from 11 to kk , inclusive. The jar number ii contains the paint of the ii -th color.

Initially the bear took a pencil and drew four segments on the coordinate plane. All of them end at point (0,0)(0,0) . They begin at: (0,2n)(0,2^{n}) , (0,2n)(0,-2^{n}) , (2n,0)(2^{n},0) , (2n,0)(-2^{n},0) . Then for each i=1,2,...,ni=1,2,...,n , the bear drew two squares. The first square has the following vertex coordinates: (2i,0)(2^{i},0) , (2i,0)(-2^{i},0) , (0,2i)(0,-2^{i}) , (0,2i)(0,2^{i}) . The second square has the following vertex coordinates: (2i1,2i1)(-2^{i-1},-2^{i-1}) , (2i1,2i1)(-2^{i-1},2^{i-1}) , (2i1,2i1)(2^{i-1},-2^{i-1}) , (2i1,2i1)(2^{i-1},2^{i-1}) . After that, the bear drew another square: (1,0)(1,0) , (1,0)(-1,0) , (0,1)(0,-1) , (0,1)(0,1) . All points mentioned above form the set of points AA .

The sample of the final picture at n=0n=0

The sample of the final picture at n=2n=2

The bear decided to paint the resulting picture in kk moves. The ii -th move consists of the following stages:

  1. The bear chooses 3 distinct points in set АА so that any pair of the chosen points has a segment on the picture between them. The chosen points and segments mark the area that mustn't contain any previously painted points.
  2. The bear paints the area bounded by the chosen points and segments the ii -th color.

Note that after the kk -th move some parts of the picture can stay unpainted.

The bear asked you to calculate, how many distinct ways there are to paint his picture. A way to paint the picture is a sequence of three-element sets of points he chose on each step. Two sequences are considered distinct if there is such number ii ( 1<=i<=k)1<=i<=k) , that the ii -th members of these sequences do not coincide as sets. As the sought number can be rather large, you only need to calculate the remainder after dividing it by number 10000000071000000007 ( 109+710^{9}+7 ).

输入格式

The first line contains two integers nn and kk , separated by a space ( 0<=n,k<=2000<=n,k<=200 ).

输出格式

Print exactly one integer — the answer to the problem modulo 10000000071000000007 ( 109+710^{9}+7 ).

输入输出样例

  • 输入#1

    0 0
    

    输出#1

    1
    
  • 输入#2

    0 1
    

    输出#2

    8
    
  • 输入#3

    0 2
    

    输出#3

    32
    
  • 输入#4

    1 1
    

    输出#4

    32
    
首页