Fitting a sample set into available space