10. There are 12 pencils of pairwise different lengths. In how many ways can they be placed in a box in 2 layers of 6 pencils each, so that in each layer the pencils are arranged in increasing order of length (from left to right), and each pencil in the upper layer lies strictly above a pencil in the lower layer and is shorter than it?
Answer: 132

Let $0 \leqslant m \leqslant n \leqslant 6$. Denote by $K(m, n)$ the set of all arrangements of $m+n$ pencils of different lengths with the conditions: 1) in the bottom row, there are $n$ pencils, starting from the right edge without gaps in decreasing order of length; 2) in the top row, there are also $m$ pencils; 3) each pencil in the top row is shorter than the pencil directly below it. Let $k(m, n)$ denote the number of such arrangements. In each arrangement from $K(m, n)$, the shortest pencil lies either as the leftmost in the bottom row (then $m<n$), or as the leftmost in the top row. Removing it, we get a correct arrangement from the set $K(m, n-1)$ in the first case, and a correct arrangement from the set $K(m-1, n)$ in the second case. Conversely, adding a short pencil to the bottom layer of any arrangement from $K(m, n-1)$ or to the top layer of any arrangement from $K(m-1, n)$ (only if $m-1<n$) will result in a correct arrangement from the set $K(m, n)$. From this, we get that $k(m, n)=k(m-1, n)+k(m, n-1)$, if $m<n$, and $k(m, n)=k(m-1, n)$, if $m=n$. In this case, $k(0, n)=1$ for all $n$.

Consider a grid board of size $7 \times 7$. Number the rows from bottom to top with numbers $0,1, \ldots, 6$, and the columns from left to right with numbers $0,1, \ldots, 6$. In the cell located in the row with number $m$ and in the column with number $n$, we will place the number $k(m, n)$. Using the above equality, fill in the table, moving from the bottom left corner to the top right. We get the table:

|  |  |  |  |  |  | 132 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|  |  |  |  |  | 42 | 132 |
|  |  |  |  | 14 | 42 | 90 |
|  |  |  | 5 | 14 | 28 | 48 |
|  |  | 2 | 5 | 9 | 14 | 20 |
|  | 1 | 2 | 3 | 4 | 5 | 6 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |

We get that $k(6,6)=132$.