I am developing a game that displays a grid of cards. Before the cards are rendered, I need to determine the layout of the grid. Given the number of cards, I need to find the number of columns and the number of rows that would be most space-efficient.
The cards being rendered are all of the same size and the maximum and minimum number of rows and columns will be $5$ and $3$, respectively. I am terrible at math, so any help would be appreciated!