You want to arrange the window of your flower shop as pleasantly as possible. You have $F$ bunches of flowers, each of a different kind, and a row of at least $F$ vases. The vases are fixed to the shelf and numbered $1$ through $V$ from left to right, so vase $1$ is the leftmost and vase $V$ is the rightmost. The bunches are movable and are identified by the integers $1$ through $F$.
These id-numbers fix the required left-to-right order: whenever $i < j$, bunch $i$ must stand in a vase to the left of the vase holding bunch $j$. For example, with a bunch of azaleas (id $1$), begonias (id $2$), and carnations (id $3$), the azaleas must be left of the begonias, and the begonias must be left of the carnations. If there are more vases than bunches, the extra vases are left empty. Each vase holds at most one bunch.
Every vase has its own character, so placing a particular bunch in a particular vase yields an aesthetic value, given as an integer. Let $A_{i,j}$ be the aesthetic value of putting bunch $i$ into vase $j$. Leaving a vase empty contributes $0$.
For example, the aesthetic values might be:
| Vase 1 | Vase 2 | Vase 3 | Vase 4 | Vase 5 | |
|---|---|---|---|---|---|
| 1 (Azaleas) | 7 | 23 | -5 | -24 | 16 |
| 2 (Begonias) | 5 | 21 | -4 | 10 | 23 |
| 3 (Carnations) | -21 | 5 | -4 | -20 | 20 |
Here azaleas look great in vase 2 but awful in vase 4.
Place every bunch so that the required order is respected and the total aesthetic value is as large as possible.