I need to find the maximum of a sum of ceiling functions. The following are given $$N,C\in\mathbb{Z}\text{ with }0\leq N\text{ and }1\leq C$$ $$\frac{p}{q}\in\mathbb{Q}\text{ with }p,q \text{ coprime and } p\geq q\geq 1$$
Maximize
$$\sum_{i=1}^k{\Bigl\lceil a_i\frac{p}{q} \Bigr\rceil}$$
where $a_i$ is a partition of $N$ with $k$ terms and $k\leq \min(N,C)$.
I only need the maximum value, not the partition of $N$. My first idea was to let $k=\min(N,C)$ and take $k\lceil \frac{Np}{kq}\rceil$ as the max. But I think that's wrong for some inputs. Any help would be greatly appreciated.
EDIT: An answer might be $k=\min{(N,C)}$, $a_1=N-\max{(0,k-1)}$, then $a_i=1$ for $i>1$?