Fateful Chess Puzzle
Profile Dynamics is Simple.
M. Dvorkin
In his early school years, Mykhailo developed an interest in drawing. However, when it came to sketching portraits, he encountered difficulties—his profile face drawings appeared jagged. Consequently, Mykhailo turned to chess, where fortunately, all the lines on the board are straight.
Upon enrolling in a specialized university, he contemplated his future field of study. As he grew increasingly fond of the term "profile," he decided to delve into the study of profile dynamics.
His journey, including his enthusiasm for programming, began with a simple problem he was challenged with at the chess club in the pioneer palace, as he confided to his friends.
Before you tackle Mykhailo's profile challenges, try solving this pivotal problem: "Determine the number of ways to place K rooks on an NxN chessboard such that they do not attack each other. Simply swapping the positions of 2 rooks does not count as a new arrangement."
Input
The input consists of natural numbers N and K (N, K ≤ 8).
Output
Output a single integer—the solution to Mykhailo's pivotal problem.