n = ceil(315 * 3 / 16);

% total number of slices is n * 16
% number of slices if each student gets 3 slices is 315 * 3
rem(n * 16, 315 * 3)
