You are given an $$$n \times m$$$ grid. At first, all cells are white.
An "O" is a set of $$$10$$$ red cells with the following shape:

A "K" is a set of $$$8$$$ blue cells with the following shape:

Note: You cannot rotate or flip these two shapes.
Count different coloring schemes containing exactly $$$10$$$ red and $$$8$$$ blue cells, so that the grid contains exactly one "O" and one "K".
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10$$$).
The only line of each testcase contains two space-separated integers $$$n,m$$$ ($$$1 \le n,m \le 50$$$).
It is guaranteed that the sum of $$$n$$$ and $$$m$$$ over all test cases does not exceed $$$50$$$, respectively.
For each test case, output a single integer, which is the number of different coloring schemes where exactly one "O" and one "K" can be placed in the grid.
54 61 15 77 511 22
2 0 24 0 21464
In the first case, the two schemes are shown below.
![]() | ![]() |