TITLE: Cutting a $m \times n$ rectangle into $a \times b$ smaller rectangular pieces
QUESTION [7 upvotes]: How many $a \times b$ rectangular pieces of cardboard can be cut from $m \times n$ rectangular piece of cardboard so that the amount of waste("left over" cardboard) is a minimum?

This question was given to me by my Mathematics Teacher as a "brain teaser".
At first I divided $m \times n$ by $a \times b,$ but then I realized that it is not possible in the given situation, as the "left over" cardboard will also be "divided" among $a \times b$.
Next I tried started thinking it terms of perimeter. I imagined all the $a \times b$ rectangles lying side by side in a "rows and columns" format(sort of a grid), without any space between them, thus forming another rectangle/square. I assumed $\lambda$ rows and $\sigma$ columns of those smaller rectangles. After a bit of calculations, my answer came out as following :
Number of smaller $a \times b $ rectangles  $\geq \sigma \times \lambda$ = $\left(\dfrac {m - m \, mod \, a }{a}\right) \times \left(\dfrac {n-n\, mod \, b}{b}\right).$
Is my "second" approach correct ?
Is there any alternate way of tackling this problem?
This might seem a 'vague' question, but can this problem be generalized to any given shape ?
Any help will be gratefully acknowledged :).

REPLY [2 votes]: A simple example, for $a=2, b=3$, and a few values for $n$ and $m$ shows that the problem 
is not easily approachable, specially in the last configuration.   
--- added----- 
It is in fact a Cutting Stock Problem as rightly indicated by @sas, however simplified
by having rectangular and fixed size items.
It is quite an interesting subject, so starting from the sketch above, let's try and establish some facts about,
without pretending to be rigourous and to provide proofs.
Premised that we use the following symbols, for the integral and fractional part and for modulus
$$
\begin{gathered}
  x = \left\lfloor x \right\rfloor  + \left\{ x \right\} \hfill \\
  \frac{x}
{t} = \left\lfloor {\frac{x}
{t}} \right\rfloor  + \left\{ {\frac{x}
{t}} \right\} \hfill \\
  x = t\left\lfloor {\frac{x}
{t}} \right\rfloor  + t\left\{ {\frac{x}
{t}} \right\} = t\left\lfloor {\frac{x}
{t}} \right\rfloor  + x\bmod t \hfill \\ 
\end{gathered} 
$$
then

Upper bound for $N$
Clearly we must have $N a b \leqslant nm$, i.e.
$$ \bbox[lightyellow]{ 
N \leqslant \left\lfloor {\frac{{n\,m}}
{{a\,b}}} \right\rfloor  = \left\lfloor {\,\frac{{n\,m/\gcd (nm,ab)}}
{{a\,b/\gcd (nm,ab)}}} \right\rfloor  = \left\lfloor {\frac{{n'\,}}
{{a'}}\,\frac{{m'}}
{{b'}}} \right\rfloor
 \tag {1}  \\
}
$$
This also indicates an equivalence in the problem when the parameters are scaled so as to keep the ratio $(nm)/(ab)$ constant,
and that we can always reduce the parameters and get $n$ and $m$ be coprime vs. $a$ and vs. $b$.
But, geometrically speaking, the down-scaling looks to be applicable only if  $max(a',b') \leqslant min(n',m')$.
An example is given in this sketch
 
Equivalence under rotation, reflection
Clearly the problem does not change under rotation or reflection.
"Cross histogram"
Consider to take a horizontal scan and to record, per each unit row, the number of layers of horizontal dimension $a$ and $b$ traversed.
Let's do the same on a vertical scan.

Clearly, every $b$ counts for a layer of width $a$ in one direction will correspond to $a$ counts for $b$ in the other direction.
And viceversa.
Conclusions
Condensing all the considerations above we are led to claim the following:
a)  Among the various possible partitions of $m$ and $n$ (in case $n'$, $m'$) as a linear combination of $a$ and $b$,
with non-negative integral coefficients, as
$$ \bbox[lightyellow] {
\left\{ \begin{gathered}
  n = n_{\,a} a + n_{\,b} b + n_{\,r}  \hfill \\
  m = m_{\,a} a + m_{\,b} b + m_{\,r}  \hfill \\ 
\end{gathered}  \right.
\tag {2} }$$
we shall choose those which, while giving minimal remainder
($n_r,m_r$), also assure best symmetry around $n/2$,$m/2$, that is
$$ \bbox[lightyellow] {
\left\{ \begin{gathered}
  n_{\,a} a \approx n/2 \approx n_{\,b} b \hfill \\
  m_{\,a} a \approx m/2 \approx m_{\,b} b \hfill \\ 
\end{gathered}  \right.
\tag {3} }$$
b) Note that the above goal of symmetry is to be achieved globally on $n$ and $m$, so that it happens that we shall compromise
somehow on one of the parameters, to keep  the best on the other.  When that happens, for the 
unbalanced parameter we are asked to choose two partions on the opposite sides of the symmetry, so that they make an optimal one 
on average, in case inserting a remainder if necessary (re. to the case $n=4,m=5$ in the first sketch).
So, practically, we are determining a pair of partitions for each parameter.
c) The above situation can be faced when $n,m$ are relatively small with respect to $a,b$. When they are much larger than $a,b$
then a partion (or two on average) close to symmetry can be found for both.  

Therefrom a possible strategy seems to be as follows (you can follow the process on one of the sketches given)

repart one side of the rectangle (e.g. $m$) according to one of its pair of partitions, putting first all the $a$'s, then the remainder, then the $b$'s;  
following the perimeter, repart the contiguous side ($n$), this time starting with the $b$'s;
pass to next side ($m$), and apply the remaining partition of the pair associated with $m$;
same for the last side;
expand the partition of the perimeter towards the inner part, as allowed

From the examples, it looks that it is possible to reach $N= \left\lfloor {\frac{{n\,m}}{{a\,b}}} \right\rfloor$ in "many" cases.