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.
The input file contains multiple testcases.
Each testcase contains two integers n (1 ≤ n ≤ 50) and k (0 ≤ k ≤ n2).
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.
4 4 8 6
260 5599888
Migrated from old NTUJ.
sgu221
No. | Testdata Range | Score |
---|