Here is a Mixed Integer Linear Problem (MILP) formulation that may be solved in practice for some instances with MILP-solvers like CPLEX. For every integer vector $(i_1,\dots,i_k)\in [1,a_1]\times\cdots\times[1,a_k]$, let us introduce two variables: a nonnegative real (rational) $x_{i_1,\dots,i_k}$ and a binary $y_{i_1,\dots,i_k}$. The $x$'s represent the elements of $M$ (with some elements being zero -- the more such elements, the better). They satisfy the following equalities: $$\forall j\in[1,k]\quad\forall t\in[1,a_j]\ :\qquad\sum_{i_1,\dots,i_k\atop i_j=t} x_{i_1,\dots,i_k} = \frac{1}{a_j}.$$ In an optimal solution, we want as many as possible $x$'s be zero and this is why we need $y$'s. In an optimal solution, they will represent indicator values for the positivity of $x$'s, i.e., $y_{i_1,\dots,i_k}=1$ iff $x_{i_1,\dots,i_k}>0$. This can be achieved with the inequalities: $$x_{i_1,\dots,i_k} \leq y_{i_1,\dots,i_k}$$ and the objective function: $$\min \sum_{i_1,\dots,i_k} y_{i_1,\dots,i_k}.$$ I have implemented this in Sage (with CPLEX) and here is a couple of examples of computed optimal $M$'s: > (3,4,5): [1/60, 1/30, 1/20, 1/12, 7/60, 2/15, 1/6, 1/5, 1/5] > (4,5,6): [1/60, 1/60, 1/30, 1/30, 1/15, 1/12, 7/60, 2/15, 1/6, 1/6, 1/6] **UPDATE.** Here is another MILP formulation, which can be used to test whether a particular value $m=|M|$ is achievable. In this approach, we typically have smaller number of variables (equal $m+2\cdot m\cdot (a_1+\dots+a_k)$), and there is no objective function, so we look only for a feasible solution. First, we introduce $m$ variables $M_1,\dots,M_m$ standing for the elements of $M$. Then for each $i\in [1,m]$, $j\in [1,k]$, $t\in [1,a_j]$, we introduce a real variable $x_{i,j,t}$ and a binary variable $y_{i,j,t}$, for which we want $x_{i,j,t}=M_i$ and $y_{i,j,t}=1$ iff in the partition of $M$ into $a_j$ parts $M_i$ contributes to the $t$-th part; otherwise $x_{i,j,t}=y_{i,j,t}=0$. We achieve this with the following constraints: $$\begin{cases} x_{i,j,t}\leq y_{i,j,t},\\ \sum_{t=1}^{a_j} x_{i,j,t} = M_i,\\ \sum_{t=1}^{a_j} y_{i,j,t} = 1, \\ \sum_{i=1}^m x_{i,j,t} = \frac{1}{a_j}. \end{cases} $$ For example, for $(a_1,a_2,a_3,a_4)=(4,5,6,7)$ and $m=14$, my implementation of this approach obtains the following elements of $M$: > [1/210, 1/140, 3/140, 1/42, 13/420, 23/420, 9/140, 11/140, 37/420, 41/420, 47/420, 19/140, 29/210, 1/7]