Procedure{borrel}{t,m,b,n,I,p,\ell}: \State $(s^*,o^*,v^*) \gets$ initialState{$t,m,b,n,I,p,\ell$} \State $(s^{**},o^{**},v^{**})\gets$ initialState{$t,m,b,n,I,p,\ell$} \While{True} State $v^*\gets 0$ \For{$i\gets 1,n$} State $\text{borSub}_i \gets \{1,...,m\}$ \EndFor \State end $\gets$ True \While{$\neg$end} State validSubsets $\gets$ True \For{$i\gets 1,n$} (canAttend,$o_i$) $\gets$ \Call{chooseObl}{$t,\text{borSub},b,s,r_i,p_i,d_i,\ell_i$} \If{$\neg$canAttend} \State validSubsets $\gets$ False \State \textbf{Break} \EndIf \EndFor \If{validSubsets} State $v \gets$ \Call{calcValue}{$\text{borSub},sM,n,m$} \If{v>v^*} o^* \gets o v^* \gets v \EndIf \EndIf \For{i\gets 1,n} State (end,borSub_i) $\gets$ \Call{subsIt}{$\text{borSub}_i,\{1,...,m\}$} \If{end} \State \text{borSub}_i \gets \{1,...,m\} \EndIf \EndFor \EndWhile \If{$v^{**}