In my university, I am responsible with the distribution of proctors with respect to the student placements to the classrooms in freshman math pool courses. I faced a problem which is sticked in my mind for a quite long time. The problem is to define a utility function for the following optimization problem. $$ \begin{aligned} & \underset{\mathbf{x}}{\text{minimize}} & & f(\mathbf{x},\hat{\mathbf{x}}) \\ & \text{subject to} & & \sum_i x_i = N,\\ &&& 0 \le x_i \le \hat{x}_i,\ i = 1, \ldots, m. \end{aligned} $$
where $\hat{x}_i$ is the capacity of $i^{th}$ classroom, $x_i$ is the number of students to be placed to the $i^{th}$ classroom, $N$ is the total number of students to be placed to $m$ classes.
The main purpose of this problem is to minimize number of proctors, which will be assigned to each 30 or less students.
For instance, let $\hat{\mathbf{x}}=\begin{bmatrix}30&40&50&60\end{bmatrix}^T$ and $N=120$. Consider two placements $\mathbf{x}_1=\begin{bmatrix}30&30&30&30\end{bmatrix}^T$ and $\mathbf{x}_2=\begin{bmatrix}30&40&50&0\end{bmatrix}^T$. Since for every 30 or less students one proctor will be assigned, the proctoring assignment vectors are obtained $\mathbf{p}_1=\begin{bmatrix}1&1&1&1\end{bmatrix}^T$ and $\mathbf{p}_2=\begin{bmatrix}1&2&2&0\end{bmatrix}^T$ respectively. Since 4 proctors are used in the first placement, it is a better choice. But I want to find or guarantee the optimal solution.
I have tried CVX tool for this optimization problem in MATLAB with $$ f(\mathbf{x},\hat{\mathbf{x}})=\sum_i ceil(x_i/30) $$ but since there are no round, ceil or remainder function usages in CVX, I can not define such a utility function.
I am considering to use MATLAB, MS Excel or Excel-like program, but I am open to any suggestions.