提示: 欢迎访问OurACM平台。
Problem 1717 Empire

Accept: 3    Submit: 18
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Long long ago,CDGG built a powerful empire,and its land was a square shape,as the picture show:

As other country,CDGG’s empire has many feadutories. As a result of these feadutories have made illustrious military exploits, the CDGG prepared to give them each a fief(a grid of square).But These feadutories are very militant, when the two leaders in the same row or at the same column of the square,they will fight with each other.As the follow three picture show,the shadow parts indicate the feadutories’ positions.The feadutories in the first two picture can fight with each other,but the third can’t.

CDGG didn’t want to see them fight with each other,so that his empire turbulent.CDGG want to arrange their’s positions,so that each of them can’t fight with any other feadutories.
Now give the size of square and the number of feadutories,your task is to calculate how many feasible ways of arranging them.The answer may be too large,you only have to output the answer mod 504.

Input

The input consists of several test cases. Each case contains one line,contains two integer n and k,indicates the size of square and the number of feadutories.The first integer is n,the second is k.(n<=100)

Output

For each case,output the answer mod 504.

Sample Input

2 2

Sample Output

4

Source

FZU 2009 Summer Training Qualification -- Hero Revival 1

Submit  Back  Status  Discuss