TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

A bishop is a piece used in the game of chess which is played on a board of square grids. A bishop can only move diagonally from its current position and two bishops attack each other if one is on the path of the other.


Given two numbers n and k, your job is to determine the number of ways one can put k bishops on an n × n chessboard so that no two of them are in attacking positions.

Input Format

The input file contains multiple testcases.

Each testcase contains two integers n (1 ≤ n ≤ 50) and k (0 ≤ k ≤ n2).

Output Format

For each testcase, print a line containing the total number of ways one can put the given number of bishops on a chessboard of the given size so that no two of them are in attacking positions.

Sample Input 1

4 4
8 6

Sample Output 1

260
5599888 

Hints

Problem Source

Migrated from old NTUJ.

sgu221

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 600