Compute the polyomino capacity of a rectangle
Python 2, 53 bytes
lambda p,q,n:p/n*q+q/n*(p%n)-min(0,n-p%n-q%n)*(p&gt;n&lt;q)

Adapts the formula given in this paper, which is:
def f(p,q,n):a=p%n;b=q%n;return(p*q-[a*b,(n-a)*(n-b)][a+b&gt;=n and p&gt;=n and q&gt;=n])/n