time limit per test: 1 sec. memory limit per test: 65536 KB
input: standard output: standard
Oh no, here it comes again Can't remember when we came so close to love before Hold on, good things never last Nothing's in the past, it always seems to come again Again and again and again
...
Bloodied angels fast descending Moving on a never-bending light Phantom figures free forever Out of shadows, shining ever-bright
Neon Knights!
Black Sabbath, "Neon Knights"
The knight is the piece in the game of chess. The knight moves the following way: first he moves 2 squares in horizontal or vertical direction and then 1 square in the perpendicular direction. Figures on the way of knight do not interfere with its movement. Two knights are in the attacking position if they can move to each other's cells.
Input
The input file contains two integers n (1 ≤ n ≤ 10) and k (0 ≤ k ≤ n2).
Output
Print a line containing the total number of ways one can put k knights on a chessboard of size n × n so that no two of them are in the attacking positions.
Sample test(s)
Input
Test #1
3 2
Test #2
4 4
Output
Test #1
28
Test #2
412
Author:
Andrew Stankevich
Resource:
Little Chess Pieces Series, SPb IFMO 2003-2004 Authumn Training Sessions