A possible general formula for this planting flowers problem? 
In a flower garden, one can grow a variety of roses, and each variety can have different degrees of growth and height. Therefore, people will adhere to the following principles of growing flowers in the garden:

*

*All flowers will be planted on the left and upper sides, but higher flowers will be more prioritized than the shorter one so that the flowers can get the best light in the morning.

*Plant flowers in rows from top to bottom, ensuring that the number of plants in the upper rows is no less than the lower rows.


For example, let say there are $2$ types of flowers with $2$ different heights are $1m$ and $2m$. Each type has $2$ flowers. So there will be a total of $8$ ways to plant according to the rules:


Let say there are N types of flower, each type has a different height $h_i$  and has $k_i \,\, (1 \leq i \leq N)$ flower(s) of that types. Is there a general formula to find all possible ways to plant flowers with respect to the rules?


*

*For the case $N = 1$, I found the following recurrence relation:

$$x_k = x_{k-1} + 2^{\left\lfloor{\frac{k-2}{2}}\right\rfloor}$$
where $k$ is the number of flowers.

*

*Edit $1$: As @MikeEarnest mentioned in the comment, the recurrence I found was wrong for $k = 8$. The number of arrangements for the case $N = 1$ is actually the partition function $p(k)$
 A: We have $m$ different species of flowers with heights $h_1 >h_2 > \cdots > h_m$,  and we have quantities $n_1, n_2, \cdots, n_m$ of each category,
for a total of $N$.
Now, if I properly understood  the problem, you want to plant them on a rectangular grid

in such a way that the higher flowers precede the lower either top-down and left-right.
That implies that the quantity of an intermediate species in a row might be higher than in the preceding row (see e.g. $q_{\,2, \, 3}$ in the sketch).
However the total number of flowers in each row shall be not higher than that in the upper row.
An algorithm to tackle the problem could be as follows.
Let's denote with $s_{\,j,\,k}$ the cumulative number of flowers of species $1$ to $k$ in row $j$, i.e. :
$$
s_{\,j,\,k}  = \sum\limits_{i = 1}^k {q_{\,j,\,i} } 
$$
Start by choosing a partition of $N$ into any allowed number of parts, call it $\pi _{\,m}$, and assign the resulting (non-increasing) parts
as the values of $s_{\,j, \,m}\; | \, 1 \le j \le \pi_{\,m}$.
That is, such a partition will define the rightmost bound of the rows (the perimeter in blu in the 2nd sketch).
Then choose a partition of $N-n_{\,m}$, with a number of parts $\pi _{\,m-1} \le \pi _{\,m}$.
Assign the result to $s_{\,j, \,m-1}$, thereby defining the perimeter of the species till $m-1$.
Proceed with the partition of $N-n_{\,m}- n_{\, m-1}$ ... ,
and so on,  till arriving to the partition of $n_1$ into a number of parts not greater than the preceding.
The total number of planting schemes will correspond to the total number of such "nested" partitions, wihich can be computerized but not expressed by a closed formula.
