Problem 5: Biships, Knights and Queens, Oh My!

Background:

In the mighty game of chess, a queen can move in any direction (diagonal, vertical, horizontal). A knight moves in a L-shape direction either two spaces in a `vertical' direction, followed by one space in a horizontal direction, or a knight moves two horizonatal spaces, followed by a vertical space. The bishop moves in a diagonal direction.

In this problem, we're interested in how many ways we can place a number of bishops, knights and queens on a 8x8 chessboard such that no piece is capable of taking another piece in 1 move. A queen and bishop can take any piece in their line of movement, a knight can only take a piece that is sitting on their destination square.

Input:

Each line of input is a test case consisting of 3 numbers separated by a space. The first number is the number of bishops to place, the second is the number of knights and the third is the number of queens. Any given test case will have no more than 3 bishops, 3 knights, and 8 queens.

Output:

The output is a single number representing the total number of ways to place those pieces on an 8x8 chessboard.

Sample Input:

0 0 8
0 3 0
1 3 5
3 3 8

Sample Output:

92
32084
73976
0